Get your own customer support community
 

opening a new tab from the sidebar

I use this code to open a new tab from the sidebar:

the mainwindow code just came from the mozilla developer wiki

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 gotoPage(url)
{
mainWindow.getBrowser().addTab(url);
}
Inappropriate?
1 person likes this idea

User_default_medium