tab snippets

Opening a new tab with Firefox

Tagged open, tab, firefox  Languages javascript

Note that this only works from a Firefox extension:

function openTab(url, focus) 
  {
    var tab = getBrowser().addTab(url);

    if(focus)
    {
      getBrowser().selectedTab = tab;
    }
   
    return tab;
  }