Link clicked not passed to firefox

Solution 1:

I have found an answer.

$ xdg-settings get default-web-browser
firefox-mozilla-build.desktop

and then find where it is:

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

Open it

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

and then change

Exec=firefox

to:

Exec=firefox %u

Solution 2:

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

with

Exec=/usr/bin/firefox %u  

(u = URL briefly)

Solution 3:

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:

/usr/share/launchpad-integration/launchpadintegration/urls.py

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?