Michael Vincent van Rantwijk, MultiZilla wrote:
> Christian Biesinger wrote:
>> Try calling getInterface(Components.interfaces.nsIDOMWindow) on the 
>> channel's notification callbacks, 
> 
> Which returns either [object ChromeWindow] or [object XPCNativeWrapper 
> [object Window]]

Yep.

(I am not sure what you are saying there. Are those results a bad thing?)

>> and if that fails, the channel's 
>> loadgroup's notification callbacks. That should give you the window you 
>> want. 
> 
> Same for:
> 
> channel.notificationCallbacks
>         .getInterface(Ci.nsILoadGroup)
>         .notificationCallbacks
>         .getInterface(Ci.nsIDOMWindow);

That's not what I meant. Try 
channel.loadGroup.notificationCallbacks.getInterface(Ci.nsIDOMWindow);

>> Keep in mind that some requests don't have an associated window.
> 
> But they might have a document:
> 
> channel.notificationCallbacks
>         .getInterface(Ci.nsIWebNavigation)
>         .document;
> 
> or the other variant.

Well if you can get a web navigation you can probably get a window directly.


-- 
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...]     --W. Shakespeare
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to