Ubuntu – In Xubuntu both Chrome and Firefox are default browsers

firefoxgoogle-chromexubuntu

I have a problem in that both Chrome and Firefox says, in their respective preferences menus, that they are the default browser. In Xubuntu's Preferred Applications, Chrome is chosen and

~$ sudo update-alternatives --config x-www-browser
[sudo] password for xxxx: 
There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
------------------------------------------------------------
* 0            /usr/bin/google-chrome-stable   200       auto mode
  1            /usr/bin/firefox                40        manual mode
  2            /usr/bin/google-chrome-stable   200       manual mode

the same for gnome-www-browser. So it would seem that Chrome should be the default browser? But the problem is, when I click a link in a Geary mail, Firefox opens. So somehow Firefox is also a preferred browser?!

I've tested the following in the Terminal:

x-www-browser: Opens Chrome

xdg-open http://localhost:8000 : Open link in Chrome

This is fine, but if I click a web link in either Geary or uses "Open link" on the link above, in the Terminal, the links open in Firefox.

Think it may have something to do with the "mimeapps.list":

msix:~/.config$ grep firefox mimeapps.list
text/html=exo-web-browser.desktop;mousepad.desktop;firefox.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop
msix:~/.config$ grep chrome mimeapps.list
x-scheme-handler/chrome=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop

Don't know what controls this list.

I want only Chrome to be default and also open web links in other applications. What could be wrong?

Best Answer

Here's what worked for me.

sudo update-alternatives --config x-www-browser

There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
------------------------------------------------------------
* 0            /usr/bin/google-chrome-stable   200       auto mode
  1            /usr/bin/firefox                40        manual mode
  2            /usr/bin/google-chrome-stable   200       manual mode

xdg-settings set default-web-browser google-chrome.desktop

Verified with xdg-settings get default-web-browser

output:

google-chrome.desktop

I believe you are missing some chrome entries from your mimeapps.list as well. My output after the commands above is as follows:

grep chrome ~/.config/mimeapps.list

application/x-mswinurl=google-chrome.desktop;
text/html=google-chrome.desktop
x-scheme-handler/http=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop
x-scheme-handler/about=google-chrome.desktop
x-scheme-handler/unknown=google-chrome.desktop

Sources:

How to change default browser AND the command line parameters used to open a link from gnome-terminal

/.config/mimeapps.list

Related Question