Links in Hub and Mail don't open the default Browser (Firefox)

I have recently faced an issue where links in virtually all applications won’t open the default Firefox browser. Here’s what I did to troubleshoot / fix the issue.

First of all some background:

  • Defaults are usually defined here ~/.config/mimeapps.list
  • Menu > Preferences > Advance Settings > File Association should give you the same view
  • You can manually replicate the issue with xdg-open "http://pantherx.org"

An excerpt from ~/.config/mimeapps.list currently lists:

[Default Applications]
x-scheme-handler/http=userapp-Nightly-6XGH80.desktop
x-scheme-handler/https=userapp-Nightly-6XGH80.desktop
x-scheme-handler/ftp=userapp-Nightly-N3I210.desktop
x-scheme-handler/chrome=userapp-Nightly-6XGH80.desktop

Interestingly there are various different references to Firefox (nightly).

Suggested fix

Menu

Working on this, I have discovered another small issue that doesn’t seem to have any impact: A bunch of outdated application references:

$ ls ~/.local/share/applications
 chrome-lejdminphegagidoeedmhlllmnggddmm-Default.desktop   userapp-Nightly-HT9VX0.desktop
 mimeinfo.cache                                            userapp-Nightly-N3I210.desktop
 monero-gui.desktop                                        userapp-Nightly-RZP540.desktop
 temp-software.desktop                                    'userapp-Telegram Desktop-1Q2J70.desktop'
 userapp-Nightly-6XGH80.desktop

Looking trough the various userapp-Nightly-* I found that 3/4 are referring to old versions:

$ cat ~/.local/share/applications/userapp-Nightly-HT9VX0.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=/gnu/store/4wyrivn52i54hmqgawm4qn7qs9q7q7fx-firefox-80.0.1/lib/firefox/.firefox-real %u
Name=Nightly
Comment=Custom definition for Nightly

Let’s delete them:

$ cd ~/.local/share/applications
$ rm userapp-Nightly-HT9VX0.desktop userapp-Nightly-N3I210.desktop userapp-Nightly-RZP540.desktop

Now I only have the userapp-Nightly-6XGH80.desktop left, which refers to the current version:

$ cat userapp-Nightly-6XGH80.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=/gnu/store/higsjf9m5cw1p35qr2cyvy55982gz557-firefox-90.0.2/lib/firefox/.firefox-real %u
Name=Nightly
Comment=Custom definition for Nightly

Mime

To manually overwrite file associations (default applications), you can run the following:

xdg-mime default userapp-Nightly-6XGH80.desktop x-scheme-handler/https
xdg-mime default userapp-Nightly-6XGH80.desktop x-scheme-handler/http

Now just run xdg-open "http://pantherx.org" to verify.

Firefox

If you find that your Firefox is suddenly missing plugins, bookmarks and so on, it’s easy enough to migrate your profile. Here’s how-to do that:

  1. Enter about:profiles in the Firefox URL bar
  2. Look for your primary profile

I found 3 different profiles; One is the profile that I usually use, one was apparently created by the off-spring Firefox, and the 3rd … I don’t even know. It seems this is related to Firefox Nightly - which is pretty much bleeding edge (too new).

Usually the first profile will be your primary profile (as in, the first you used).

So set Set as default profile

Now close all open Firefox windows, and try again:

xdg-open "http://pantherx.org"

You should be greeted with the correct version, with all your plugins and preferences.

Good luck!

1 Like