[Project_owners] Getting the panel (tab) id for tabs out of focus
Jesper Staun Hansen
jesper at heroes-addon.dk
Mon Jun 2 05:45:09 PDT 2008
Found other methods and this can be discarded.
Jesper Staun Hansen wrote:
> As many already know then I have been trying get the tab id which is
> queue for every tab (panel).
> There is no trouble in getting the tab id for the tab in focus with:
> getBrowser().selectedTab.linkedPanel
> But having trouble with a working tab.
>
> There is some code in firefox's tabbrowser.xml (see
> http://lxr.mozilla.org/mozilla/source/xpfe/global/resources/content/bindings/tabbrowser.xml#926)
> 925 var tabBrowser = this.parentNode.parentNode.parentNode;
> 926 var tab =
> document.getAnonymousElementByAttribute(tabBrowser, "linkedpanel", this.id);
>
> These lines should get the current working tab and not the selected tab.
> But its not working as this.parentNode is not defined.
> So I got some info back with this (all other parentNode usage is null):
>
> 330 try {
> 331 var tabBrowser =
> getBrowser().parentNode.parentNode.parentNode.parentNode;
> 332 var tab =
> document.getAnonymousElementByAttribute(tabBrowser, "linkedpanel", this.id);
> 333 dump("..."+tab+"\n");
> 334 } catch (e) { dump("..."+e+"\n"); }
>
> Which returns this:
> [Exception... "Could not convert JavaScript argument arg 0
> [nsIDOMDocumentXBL.getAnonymousElementByAttribute]" nsresult:
> "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame ::
> chrome://test/content/test.js :: getTab :: line 332" data: no]
>
> so it seems like there is "something"...
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>
>
More information about the Project_owners
mailing list