更改firefox选项卡索引

更改firefox选项卡索引,firefox,firefox-addon,xul,Firefox,Firefox Addon,Xul,我正在开发一个插件,我想更改选项卡的索引。 我已经知道如何使用jetpack,但我必须与XUL合作。 有什么想法吗? 谢谢绝对是 const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import('resource://gre/modules/Services.jsm'); var mostRecentChromeBrowserWin = Services.wm.getMostRecentWindow('navigat

我正在开发一个插件,我想更改选项卡的索引。 我已经知道如何使用jetpack,但我必须与XUL合作。 有什么想法吗? 谢谢

绝对是

const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');

var mostRecentChromeBrowserWin = Services.wm.getMostRecentWindow('navigator:browser');
if (mostRecentChromeBrowserWin.gBrowser && mostRecentChromeBrowserWin.gBrowser.tabContainer) {
mostRecentChromeBrowserWin.gBrowser.selectedTab = mostRecentChromeBrowserWin.gBrowser.tabContainer.childNodes[0]; //make the 0 here there number, it starts with 0
}

“索引”是指要将选项卡从一个位置移动到另一个位置吗?还是选择一个选项卡?