Christian Biesinger wrote:
> Marie Kesquetta wrote:
>> I can't find a way to determine what window generated the request. How 
>> do i do so ? Is it at all possible ?
> 
> Try calling getInterface(Components.interfaces.nsIDOMWindow) on the 
> channel's notification callbacks, 

Which returns either [object ChromeWindow] or [object XPCNativeWrapper 
[object Window]]

> 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);

> 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.

-- 
Michael Vincent van Rantwijk
- MultiZilla Project Team Lead
- XUL Boot Camp Staff member (ActiveState Training Partner)
- iPhone Application Developer

_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to