Many thanks Christian and all. This seems to work fine for me:

channel.notificationCallbacks.getInterface(Components.interfaces.nsIDOMWindow);

 From the tests i have done, i didn't have to use the loadGroup.

Marie

Christian Biesinger wrote:
> 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.
> 
> 
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to