update-alternatives
changes the application to use to open a web browser, not the application to use to open a web page. The two are not directly related: “I want to browse the web” is different from “I want to browse this web page”, and there are different kinds of content that happen to all open in a web browser.
What you need to change is which application is associated with the MIME type text/html
, and perhaps others. These are configured through the /etc/mailcap
file.
On Debian, /etc/mailcap
is automatically generated from the applications you have installed. When multiple applications can open the same type, there is a priority system (similar, but distinct, from the priority system for alternatives). You can override these priorities by adding entries to /etc/mailcap.order
. For example, the following line will cause Firefox to be used in preference of any other application for all the types it supports:
firefox:*/*
After you've changed /etc/mailcap.order
, run /usr/sbin/update-mime
as root to update /etc/mailcap
.
If you want to use a program that doesn't come from a Debian package, edit it directly into /etc/mailcap
, in the User Section
.
# ----- User Section Begins ----- #
text/html; /home/user/firefox/firefox '%s'; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html
# ----- User Section Ends ----- #
If you want to set preferences for your own account, define them in ~/.mailcap
: the entries in that file override the ones in /etc/mailcap
. You have to put full mailcap lines there, such as
text/html; /home/user/firefox/firefox '%s'; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html
A link to a “similar question” (xdg-open default applications behavior – not obviously related, but some experimentation showed that the behaviour is indeed equivalent to the one of xdg-open
) led me deeper down the rabbit hole. While Firefox does not rely on, or inherit rules from, xdg-open
, it uses the MIME specification files just as xdg-open
does.
On a user basis, the MIME opening behaviour is configured by the specification file ~/.local/share/applications/mimeapps.list
.
For me, this file contains just a few reasonable protocols and HTML (and similar) files connected to userapp-Firefox-??????.desktop
, but you could easily add a line like
application/pdf=evince.desktop
to solve that problem on a per-user basis. If the file does not exist yet, make sure to add a section header, such as
[Default Applications]
application/pdf=evince.desktop
Deeper down, the mime types are defined in /usr/local/share/applications/mimeinfo.cache
(this may be /usr/share/…
if you are not on a FreeBSD system), which does list application/pdf=inkscape.desktop;evince.desktop;
. Both evince.desktop
and inkscape.desktop
in that folder contain MimeType=[…]application/pdf;[…]
.
The mimeinfo.cache
is automatically generated from the mime types listed in the .desktop
files without any well-defined order, so you will have to either remove the PDF mime type from Inkscape and regenerate the cache using update-mime-database
, or generate a mimeapps.list (either globally in /usr/local/share/applications/
, or for your user in ~/.local/share/applications/mimeapps.list
).
Best Answer
Type
about:config
in the address barSearch for
ui.allow_platform_file_picker
Toggle it to true
Restart Firefox.