Open Bug 1847615 Opened 2 years ago Updated 2 years ago

Setting as 'default browser' on Linux does not associate with x-scheme-handler/http

Categories

(Firefox :: Shell Integration, defect)

Firefox 102
defect

Tracking

()

UNCONFIRMED

People

(Reporter: srk31, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

On a Debian-based system with both firefox-esr and google-chrome installed, set Firefox to handle HTML but Chrome to handle http: and https:.

$ xdg-mime default google-chrome.desktop x-scheme-handler/http x-scheme-handler/https
$ xdg-mime default firefox-esr.desktop text/html

Then check about:preferences. It will say Firefox is the 'default browser'.

Then try some external application that can follow HTTP or HTTPS hyperlinks, e.g. LibreOffice opening any document containing such a hyperlink. Follow the link (Ctrl+Click on LibreOffice).

Actual results:

It launches Chrome, not Firefox.

Expected results:

Either it should have launched Firefox, or Firefox should not claim to be the default browser. Note that the application (here LibreOffice) does not maintain its own browser setting.

The Linux-specific (distro-specific) instructions in Firefox support pages (https://support.mozilla.org/en-US/kb/setting-firefox-default-browser-does-not-work) appear to work by associating Firefox with the MIME type "text/html". My best guess is that this is also what the about:preferences page is checking for when it says "Firefox is currently your default browser". (But I am just guessing about this.)

An association with text/html is not enough... it is also necessary to associate with x-scheme-handler/https and x-scheme-handler/http, and I found that Firefox was not associated with these even while it claims to be the default browser. The associations can be queried using the 'xdg-mime' tool, specifically

$ xdg-mime query default text/html
$ xdg-mime query default x-scheme-handler/https
$ xdg-mime query default x-scheme-handler/http

... I found that the latter two were not associated with Firefox.

They can be updated with (on my system, using the ESR version of Firefox)

$ xdg-mime default firefox-esr.desktop x-scheme-handler/http x-scheme-handler/https

After doing this, I get the expected behaviour. It would be great if Firefox could do this automatically when setting itself as the default browser.

This is related to bug 1599717 'Consider delegating "is this the default browser" checks to "are we the default for http/https protocols" checks on the external protocol service' and bug 1489541 'Firefox says it is default browser in KDE despite xdg default-web-browser setting'. However, I don't think it is the same. For example, the xdg 'default-web-browser' setting is empty on my system; it does not point to Chrome.

The Bugbug bot thinks this bug should belong to the 'Core::Networking: HTTP' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking: HTTP
Product: Firefox → Core
Component: Networking: HTTP → Shell Integration
Product: Core → Firefox
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.