[Project_owners] Getting Source Tab When Listening to http-on-modify-request

Neil neil at parkwaycc.co.uk
Thu Mar 1 01:47:49 PST 2007


Kyle Wilgus wrote:

> var oHttp = 
> aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
> var interfaceRequestor = 
> oHttp.notificationCallbacks.QueryInterface(Components.interfaces.nsIInterfaceRequestor); 
>
> var DOMWindow = 
> interfaceRequestor.getInterface(Components.interfaces.nsIDOMWindow);
> var loadedDoc = DOMWindow.document;
>
> Does anyone know where I can go from here? Is it possible to get the 
> tab object from the window or document?

If you can get hold of the nsIDocShell object (hopefully by getInterface 
on the callbacks but if not then getInterface on the window) then I 
think you can QI it to an nsIDocShellTreeItem, get its rootTreeItem, 
then getInterface on that to an nsIDOMWindow, then call 
getBrowser().getBrowserIndexForDocument(DOMWindow.top.document).


More information about the Project_owners mailing list