Re: scopes, execution contexts, and scripts
"John J. Barton" <[email protected]> Tue, 26 Jan 2010 09:58:57 -0800
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
Boris Zbarsky wrote:
> On 1/25/10 6:18 PM, John J Barton wrote:
>> If true, we chase the global.parent until it is null or equal to itself,
>> then test
>> if (context.window == rootWindow)
>> where context.window is set to a previous reference from the same(?) API
>> call.
>
> OK, so this is correctly testing outer window identity. In particular,
> this is the object that (currently) does NOT change identity when you
> perform navigation (e.g. clicking a link).
>
> Is that really what you want?
In my unload handler for the outer DOM window I get called with window
location = about:blank. But when I clean up the window, it has a new
location and deleting it deletes the information I want:
// domWindow.location is about blank here...
setTimeout(function delayCleanup() // to allow the unload handlers to
complete
{
// domWindow.location is chrome://test/content/testDialog.xul
TabWatcher.unwatchTopWindow(domWindow);
});
So somehow about:blank is getting an unload message but the domWindow
object I obtained from the unload handler event.target.defaultView; is
morphing into the window that supports my dialog.
jjb