firefox addon - How to get the tab Index of the right clicked inactive tab? -
firefox addon - How to get the tab Index of the right clicked inactive tab? - who tab index of right clicked tab fires tab context-menu. tab not active tab (not selectedindex )? as example. "close tabs right" in tab context menu works regardless of tab (active/not-active) tab right-clicked. how right tab index? listen for popupshown event of tabcontextmenu element. since restartless addon assume have reference chromewindow. class="lang-js prettyprint-override"> var tabcontextmenu = chromewin.document.getelementbyid("tabcontextmenu"); tabcontextmenu.addeventlistener("popupshown", function(){ var rightclickedtab = chromewin.tabcontextmenu.contexttab; // proceed wish }, false); you can add together own menu item , hear command event. in case, remember cleanup when extension gets unloaded. firefox-addon firefox-addon-restartless