How to open everything (url, search, bookmarks) in a new tab with Firefox 3
Update: I’ve put up a new howto with new instructions for Firefox3.5 and 3.6 ans the new userChrome1.1.
When Firefox 3 started its beta program, I decided to give it a shot. Since then, I never came back to Firefox 2. Firefox 3 was faster, stronger, better
than its predecessor. However, there was one point where Firefox 3 has some problems : extensions. Many extensions where not working anymore. While this is now fixed with many extensions updated, Firefox 3 includes the new “places” functionnality that replaces bookmarks, history etc… And this new functionality irremediately broke my custom userchrome.js for opening bookmarks in tabs (without midlle clicking, that is). Since I only open bookmarks in tabs, with was a little troublesome for me, but, being the only grip I had, I decided to live with it. Until today, where I finally figured out how to write a new “magic line” in my userchrome.js, thanks partly to tab mix, partly to google, and partly to my brain
.
So, here is the complete howto:
- 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.openintaband 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). - How to open urls in a new tab. This one as well bookmarks requires userchrome.js. This is a very small extension that allows javascripts snippets to be executed the same way you have userChrome.css styles added to a page. I used version 0.8, but I think 0.7 version works as well. So go on and download it, then create a userChrome.js file 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). From this point, you can fill it directly with the code provided here or use the sub-script/overlay loader as in my own userchrome (allows the loading of other scripts). If you want, you can download my own userChrome.js directly and put it in the chrome folder. Now you can paste this code inside a .uc.js file in the same folder or inside userChrome.js:
eval("BrowserLoadURL = " + BrowserLoadURL.toString().replace("e;", "$& if ((gBrowser.currentURI.spec != 'about:blank' || gBrowser.webProgress.isLoadingDocument)) { var tab = gBrowser.addTab(); gBrowser.selectedTab = tab; }"));This will open a new tab for url typed in url bar. You will have to restart your broswer to have the new behaviour.
- How to open bookmarks in new tab. This was the most difficult task since very few information is available on the internet. The key was using PlacesUIUtils for accessing functionnality. The code is:
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.
The whole OpenInTabs.uc.js is available if you want both functionality, just drop it into the same folder as userChrome.js. As a bonus, you can download ChromaTabs for Firefox 3 if you like colored tabs. If you have any question or remark, please leave a comment. Have fun with firefox 3 !
Update: 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.
Update: Now bookmarklets are supported.
Update 2009/03/01: For Firefox 3.1, the BrowserLoadUrl doesn’t exist anymore. There is new way to have correct behaviour:
(function() {
urlbar = document.getElementById("urlbar");
eval("urlbar.handleCommand = " + urlbar.handleCommand.toString().replace("&& aTriggeringEvent.altKey","&& !aTriggeringEvent.altKey"));
})();
This switch the Alt behaviour. If you want to open in the same tab, hold Tab, else, it will open automagically in a new tab (this is so easy that I’m asking myself why they did not include it as userpref). Have fun !
How to beautify old websites
about 1 year ago - Aucun commentaire
In this world of an endless quest for information (I’m speaking of the great Internet), it is common to stumble upon old websites or websites that have been generated by an old software. A perfect example of this would be howtos, which, while they are very useful, really look like someone shitted on my monitor.
Un phénomène intéressant
about 2 years ago - Aucun commentaire
Les conséquences du download day pour firefox sont parfois étranges. J’en veux pour preuve le graphe ci dessous des statistiques d’accès à mon blog On notera un pic intéréssant le 18 juin, qui correspond au lendemain (ou au jour même suivant les lieus) de la sortie de Firefox 3. Du coup, tout le monde se
Download day pour Firefox 3
about 2 years ago - Aucun commentaire
Aujourd’hui c’est le grand jour (enfin jour nuit demain pour nous les Européens) pour Firefox 3, je veux bien entendu parler du Download Day ! Joignez vous aux millions d’utilisateurs convertis à Firefox 3. Il suffit pour cela se rendre sur la page de téléchargement et de l’installer. La page de téléchargement en français pour
How to share your scanner on a network with Fedora 9
about 2 years ago - 4 commentaires
Since I was fed up with one of my last Windows, I’ve decided to switch my server from Windows to Fedora 9. I’m more used to Ubuntu, and I was shocked by the huuuge differences between Fedora and Ubuntu: No sudo (20 seconds to change) alias apt-get=yum Synaptic is now called PackageKit That’s all. I
Faire péter le highscore avec Firefox 3
about 2 years ago - 1 commentaire
Comme chacun le sait, Firefox c’est le BIEN. Et il se trouve que la version 3 est tout de même vachement mieux que la version 2. Du coup, les gens de chez Mozilla se sont dit qu’il fallait faire péter le highscore en téléchargeant tous comme des mouffettes en chaleur. Le but c’est d’avoir une
Real use of Safari on Windows : Nice fonts on your Linux box
about 3 years ago - 6 commentaires
Recently, I tried (as many) the recent beta of Safari on Windows. While the experience was far from nice (crashes, problem with rendering…) I noticed something very interesting : Apple is including the latest version of their Lucida Grande font in the package. This is quite nice, because the only version you can usually find

about 7 months ago
Hello-I’m really struggling to get this to work with FF3. I had it working in the past but my pc crashed(other reasons) and I had to reload the OS again. I have downloaded the new add-on userchromejs 1.1 and deleted the script it came with and replaced with your userchrome.js script but I can not get it to work. I’ve even put the openintab.jc script in the same userchrome.js file and still can not get it to work. What am I doing wrong? Im in the correct profile folder that contains the following:
userchrome.css
usercontent.css
userchrome.js
Can you run me through step by step?
your help is much appreciated.
about 7 months ago
@knackll
I’ve put new instructions with UserChromejs1.1. This was your problem I think. Please check the new article !
about 4 months ago
Great article! Thank you, buddy!
I hate FireFox opens bookmark in current tab, that make me dizzy anyway! And I can’t customize keyboard shortcuts to my favourite style. Hope FireFox can give more customization options in future versions.
about 4 months ago
Glad it helped you.
about 1 month ago
yes, good article