Xfce4 opening links in Chromium despite Firefox having been set as the default browser
Installing a laptop with the shiny new Debian Bookworm release finds a few interesting things broken that I probably had fixed in the past already on the old laptop.
One, that was increadibly unintuitive to fix, was lots of applications (like xfce4-terminal or Telegram) opening links in Chromium despite Firefox being set as the preferred webbrowser everywhere.
update-alternatives --config x-www-browser
was pointing at Firefox already, of course.
The Xfce4 preferred application from settings was Firefox, of course.
xdg-mime query default text/html
delivered firefox-esr.desktop
, of course.
Still nearly every link opens in ███████ Chromium...
As usually the answer is out there. In this case in a xfce4-terminal bug report from 2015.
The friendly "runkharr" has debugged the issue and provides the fix as well. As usually, all very easy once you know where to look. And why to hate GTK again a bit more:
The GTK function gtk_show_uri()
uses glib's g_app_info_launch_default_for_uri()
and that - of course - cannot respect the usual mimetype setting.
So quoting "runkharr" verbatim:
1. Create a file `exo-launch.desktop´ in your `~/.local/share/applications´ directory with something like the following content: [Desktop Entry] Name=Exo Launcher Type=Application Icon=gtk-open Categories=Desktop; Comment=A try to force 'xfce4-terminal' to use the preferred application(s) GenericName=Exo Launcher Exec=exo-open %u MimeType=text/html;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;application/x-mimearchive; Terminal=false OnlyShowIn=XFCE; 2. Create (if not already existing) a local `defaults.list´ file, again in your `~/.local/share/applications´ directory. This file must start with a "group header" of [Default Applications] 3. Insert the following three lines somewhere below this `[Default Applications]´ group header [..]: x-scheme-handler/http=exo-launch.desktop; x-scheme-handler/https=exo-launch.desktop; x-scheme-handler/ftp=exo-launch.desktop;
And ... links open in Firefox again. Thank you "runkharr"!