Firefox-logo.png

This is an updated Howto for Firefox 3.5 and Firefox 3.6 with the new extension UserChrome 1.1. You can still read the old howto for Firefox 3.0 and 3.1.

Here is how to open everything (yes, everything !) in a new tab.

  1. How to open search box in a new tab. This one is easy, just open about:config (type about:config in url bar) and filter with “search”. Look for browser.search.openintab and put its value to “true”. Voilà, new tabs for search box (a must if you ask me, plus combo if you have the right search engines – i.e. not only google).
  2. Install UserChrome 1.1 or more recent from the extension website.
  3. Create a userChrome.js in your chrome folder (inside your user profile folder, look at the Chrome folder article and Profile folder article on MozillaZine if you need help). Put this content inside:
    userChrome.import("*", "UChrm");
  4. How to open bookmarks in a new tab. Put this inside OpenInTab.uc.js in the same folder as userChrome.js.
    eval("PlacesUIUtils.openNodeIn = " + PlacesUIUtils.openNodeIn.toString().replace("openUILinkIn(aNode.uri, aWhere);","if ((gBrowser.currentURI.spec != 'about:blank' || gBrowser.webProgress.isLoadingDocument) && (aNode.uri.indexOf('javascript:') == -1)) {openUILinkIn(aNode.uri, 'tab');}else{openUILinkIn(aNode.uri, aWhere);}"));
    You will have to restart your broswer to have the new behaviour.
  5. How to open urls in new tab. Put this inside OpenInTab.uc.js in the same folder as userChrome.js.
    (function() {
    urlbar = document.getElementById("urlbar");
    eval("urlbar.handleCommand = " + urlbar.handleCommand.toString().replace("&& aTriggeringEvent.altKey","&& !aTriggeringEvent.altKey"));
    })();

    You will have to restart your broswer to have the new behaviour.

The whole OpenInTabs.uc.js is available if you want both functionality, just drop it into the same folder as userChrome.js.  If you have any question or remark, please leave a comment. Have fun with Firefox !

Note: If you want to have open in tab functionality for only some tabs, here are the shortcuts :

  • Url and search : Press Alt+Enter to open in a new tab. With url you can combine Alt with the classic Ctrl(end in .com), Shift(in .net) and Ctrl+Shift(in .org). That is, google +Ctrl+Shift+Alt = www.google.org in a new tab.
  • Bookmarks : Ctrl+Click on a bookmark opens it in a new tab.
Partagez !
  • Digg
  • Facebook
  • Twitter
  • Identi.ca
  • Reddit
  • del.icio.us
  • Netvibes
  • StumbleUpon
  • Technorati
  • NewsVine
  • blogmarks