Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When Firefox is set as my default browser, any links cliked in another application open a new blank Firefox window, not a new tab or a new window with the page I want.

Is that a problem with the configuration of firefox, of "Preferred Applications" or what else?

The firefox executable script works fine, because doing firefox in a console window does the correct thing. Is there a way I can edit the "preferred applications" manually?

share|improve this question
Which version of Ubuntu are you running? Do you have more than one version of Firefox installed? – wojox May 7 '11 at 16:06
That may be because firefox needs some special commandline argument to open link in new window. Try entering firefox --help in console to see. – Barafu Albino May 7 '11 at 16:29
I'm running 11.04, but the problem could have been there before. I wanted to switch from chrome to firefox when version 4 came out. Gave up because of this issue. Only firefox 4 installed – jfoucher May 7 '11 at 19:32
@barafu man firefox tells me firefox [OPTIONS] [url] but firefox --help gives the following error: /usr/lib/firefox-4.0.1/firefox-bin: error while loading shared libraries: cannot open shared object file: No such file or directory – jfoucher May 7 '11 at 19:36
@jfoucher: I get that error as well, to make that error dissappear, add the library path: LD_LIBRARY_PATH=/usr/lib/firefox-4.0.1 firefox --help. What application are you experiencing issues with? – Lekensteyn May 7 '11 at 20:03

I have found an answer.

xdg-settings get default-web-browser


and then find where it is:

locate firefox-mozilla-build.desktop


open it:

vi /home/user/.local/share/applications/firefox-mozilla-build.desktop

and then change this term:

[Desktop Entry]
Comment=Web Browser


[Desktop Entry]
Comment=Web Browser
Exec=firefox %u

also firefox to firefox %u.

I hope this works.

share|improve this answer
I was having problems because I use Firefox Developer Edition which is installed manually, including the creation of the .desktop file. This solves it. – ecc Sep 7 '15 at 12:29
Had the exact same error with Chromium. Had to add the %u to the file ~/.local/share/applications/chromium-browser.desktop – Birger Jun 20 at 6:34
It's 2016 and this answer is still relevant and correct. Also using Firefox Developer Edition. – Tiny Jun 30 at 9:32

You were not really helpful with "any application", but I've tried to find an application in which I could open an URL. I've tested the "Get Help Online..." option from the Help menu, which confirmed that URLs are opened in new windows.

Using my imagination, I watched new commands coming by executing:

while : ;do ps x -o args | head -6 | tail -3; sleep .5;echo '___'; done

After executing this, I quickly pressed the previously mentioned "Get Help Online..." menu option. As the command appears, I escape from the command by pressing Ctrl + C (interrupt). The command is a python call. The relevant file for opening the URL is:


By analyzing that file, I conclude that a new Firefox window is forced if the application to be run is firefox %s (determined by gconftool-2). To change this behavior, set the key /desktop/gnome/url-handlers/http/command to firefox %u.

To do so, open a terminal and execute:

gconftool-2 --set /desktop/gnome/url-handlers/http/command --type string 'firefox %u'

For a GUI way, see How do I use the gconf editor?

share|improve this answer
thanks for all your help. When I say any application, that's because I haven't found an application in which links clicked open properly in firefox. I tried Hotot, Gwibber, ubuntu one, empathy, skype, and others. You solution sounded good but did not solve the problem unfortunately. I think my problem is the same as this question only reversed... – jfoucher May 7 '11 at 21:49
This one is also quite similar: I tried all the steps listed without any success – jfoucher May 7 '11 at 21:50
$ ps x -o ags gives error: unknown user-defined format specifier "ags" – tsbertalan Mar 21 at 13:33
@tsbertalan It should have been "args", I have corrected it now. – Lekensteyn Mar 25 at 11:30

Symptom : Click on a link in an appli like Thunderbird or LibreOffice opens a blank tab or page in Firefox.

Solution : Find the file (or equivalent) userapp-firefox-S2GY5X.desktop in folder /home/myself/.local/share/applications and replace

Exec=/usr/bin/firefox %f


Exec=/usr/bin/firefox %u  (u = url briefly)
share|improve this answer

I have FF 6.0 and have Ubuntu 11.04. I go to FF > Edit> Preferences > Tab (which is a tab in this window) and you have a bunch of choices as to how your tabs should react.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.