Making firefox your default browser (and open URLs in a new tab) in Gnome

Okay, that was a wordy title but what can I say, it fits the bill. I wanted to use Firefox as my default browser, yet open new links in a new tab. This is how I managed to make it work.

I created firefox-tab.sh in my ~/bin. In it, I put in one line:

firefox -remote “openurl($@, new-tab)” || firefox “$@”

What this does is tell firefox to open the url in a new tab, or if firefox isn’t running, launch firefox and open the url.

Next, I told GNOME to use `~/bin/firefox-tab.sh %s` as my default browser (vary as necessary for your window manager). Now, whenever I click on a link, it opens in firefox. It’s quick, simple, and does what it needs to do. I’d prefer to make it open the tab in the background, but I haven’t found anything in the remote documentation that indicates this is possible.

This entry was posted in Uncategorized and tagged by Adam. Bookmark the permalink.

1 thought on “Making firefox your default browser (and open URLs in a new tab) in Gnome

  1. In Firefox; under Tools|Options|Adanced|Browsing, see “Open links in the background”. Hope it works for you.

Leave a Reply

Your email address will not be published. Required fields are marked *