Links from apps always open a file:// URL

Solution 1:

I found this bug report which described the same problem.

One of the first few suggestions was to check System Settings → Applications → Web Browser and change the setting from in an application based on the contents of the URL to explicitly choose a web browser.

I'm using Firefox Developer Edition which I've installed manually because they don't have a Debian package for it. My web browser was set to with the following command and I had selected the menu entry (.desktop file) I created for the browser.

I changed the setting to "in an application based on the contents of the URL" (basically, the opposite of the recommendation in the bug report) and the problem went away. I think this only worked because I've already set Ff Dev Edition as my default browser with update-alternatives and in a few configuration files I don't remember off the top of my head.

This fixed the problem, but there are still some unanswered questions:

  1. Why would it download a web page before opening it, regardless of the setting?
  2. How do I add a manually installed browser to the drop-down under the in the following application option?

Solution 2:

In case that Vince's answer doesn't work which happened to me:

I have Firefox manually installed, instead of using the version from apt install firefox and start Firefox by running its binary file.

I fixed the issue by going to System Settings → Default Applications and selecting the firefox-bin file within the downloaded installation folder of Firefox.