更改焦点选项卡javascript imacros

时间:2015-01-08 10:13:14

标签: javascript imacros

此代码无效,如何在选项卡上切换焦点。还有另一种方式吗?

var tabOne;
tabOne =  "CODE:";
tabOne +=  "TAB T=1";


iimPlay(tabOne);

2 个答案:

答案 0 :(得分:1)

我明白了......

var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);

function TabLeft()
{
mainWindow.gBrowser.tabContainer.advanceSelectedTab(-5, true);
return "True";
}    
TabLeft();

答案 1 :(得分:0)

代码是:

var tabOne;
tabOne =  "CODE:";
tabOne =  "TAB OPEN"+"\n";
tabOne +=  "TAB T=2"+"\n";


iimPlay(tabOne);

OR

var tabOne;
tabOne =  "CODE:";
tabOne +=  "TAB T=1"+"\n";


iimPlay(tabOne);

我很想知道你的代码是做什么的。