Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iframe link to open Safari



You don't need the "window.xxx."—the call is simply widget.openURL (url). The widget object that the Dashboard runtime injects into the web view is independent of the DOM, so you don't have to trace back to it, provide a path, etc.

On Jun 12, 2005, at 2:44 AM, Steve Weyer wrote:

> From: Hans Inge Hagen <email@hidden>
> Date: Fri, 10 Jun 2005 01:58:08 +0200

> I am trying to open safari from a link in an iframe within my widget.
> (my iframe content are loded as a php file from my server)


I have a similar situation in 10.4.1. I display one of two pages in an iframe -- both come from a server that I control. one is PHP; the other is vanilla HTML.

I can use "if (window.widget) window.widget.openURL(...)" in the main window of my widget it works fine -- opens a Safari window

however, if I set up a script within an iframe to open a link, window.widget fails. so does window.top.widget and window.parent.widget.

// in iframe
function wclick(link) {
    if (window.top && window.top.widget) {
        window.top.widget.openURL(link.href);
        return false;
    };
    link.target = "_top";
    return true;
}
...
<A href="some link" onClick="return wclick(this)">

clicking on the link works fine in Safari (i.e., displays link in main window, not the iframe)
but widget displays in "_top" also -- doesn't use openURL.


if window.top isn't the correct way to access main window, what is? or other workaround?

or is this a bug in current widget? or somehow considered a security hole?

Steve

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Dashboard-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >re: iframe link to open Safari (From: Steve Weyer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.