Skip to content Skip to sidebar Skip to footer

How To Get Tab From Nsidomwindow?

A noob at firefox extension development here. Is there a way to find Tab object from a given nsIDOMWindow? let wm = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIW

Solution 1:

To get the current tab you can do:

domWindow.gBrowser.selectedTab

To get the set of all tabs you can use:

domWindow.gBrowser.tabContainer 

In here you can use tabs methods to select a specific index, etc. You can see more information in tabbrowser - XUL, Tabbed browser - Code Snippets and

Post a Comment for "How To Get Tab From Nsidomwindow?"