Firefox snap cannot be set as default browser

After installing firefox snap and removing firefox deb, the commands x-www-browser, x-gnome-browser and sensible-browser all cause chrome to be launched instead.

Running sudo update-alternatives --config x-www-browser shows that firefox is no longer an option, which is predictable as this system works entirely from debian packaging.

This means there is no way to configure firefox snap as the default browser on the system.

1 Like

Indeed the update-alternatives mechanism isn’t integrated with snaps (yet?). This is essentially the same problem as was reported for chromium and addressed by a postinst maintainer script in the transitional debian package that installs the snap. However we don’t have such a transitional package for firefox yet.

Note that the title of this post is a bit misleading: firefox can be set as default browser, using different DE-friendly methods:

  • from firefox itself, browse to about:preferences and click the “Set default” button
  • in a GNOME desktop environment, run gnome-control-center default-apps and select the entry for the firefox snap there
  • in a terminal, run xdg-settings set default-web-browser firefox_firefox.desktop
1 Like

Can I use Chrome as a default browser on Ubuntu?

Yeah it should be possible

Can you share a process?

Click on the Settings icon and in the Search tab start typing Default Applications. Click on Default Applications to open the panel. Find “Web,” and switch from Firefox to Google Chrome.

Well, it’s kind of the same matter here : I guess some symlinks are needed in /usr/bin and /etc/alternatives/ then something like

sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/firefox 100

may help.

These ensure Firefox is default web browser from the system point of view - but Firefox itself may still ask to be set as default - which you can ignore or silence ( just uncheck the « always check Firefox is default » in its preferences ) since the system already uses it as default.

from firefox itself, browse to about:preferences and click the “Set default” button

Does not work. Does not do anything other than silently fail. Chrome continues to be the default browser.

xdg-settings set default-web-browser firefox_firefox.desktop

Does not work. Again, it just silently fails to set firefox as the default browser.

Did you try your suggestions before responding? My test procedure is: double click *.html file on the desktop, see what opens. For me, it’s Chrome, even after your suggestions. Therefore, these suggestions do not work, and therefore the title of the post is not misleading … firefox SNAP can’t be set as the default browser.

That’s not an accurate test case: firefox might be declared as the default browser, but you might also have a specific application set to open files with the .html extension.

Can you please share the output of xdg-settings get default-web-browser ?

Sadly, I can’t. I immediately uninstalled the SNAP after finding directions to install the normal version via APT.

Unfortunately the SNAP has other problems as well, so I’m just going to stick with the normal version I guess.