#1038670 firefox-esr: Can't set Firefox as a default mailing application

Package:
firefox-esr
Source:
firefox-esr
Description:
Mozilla Firefox web browser - Extended Support Release (ESR)
Submitter:
Dmitry K
Date:
2023-06-19 21:15:04 UTC
Severity:
normal
Tags:
#1038670#5
Date:
2023-06-19 21:13:57 UTC
From:
To:
Dear Maintainer,

I have selected "Use Gmail" in Firefox Settings -> General -> Applications ->
mailto.
Then I wanted to assign Firefox as a default mailing app in Default
Applications of Gnome settings in order to launch Firefox with Gmail
automatically from external apps. However, Firefox wasn't listed among
available options for Mail.

The reason is probably in the fact that x-scheme-handler/mailto isn't listed in
MimeType field of /usr/share/applications/firefox-esr.desktop:

MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-
handler/http;x-scheme-handler/https;

The man page of xdg-mime says: "The application's desktop file must list
support for all the MIME types that it wishes to be the default handler for".
So the fix might look as follows:

MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-
handler/http;x-scheme-handler/https;x-scheme-handler/mailto;

As a workaround I had to assign Firefox manually via the configuration file
~/.config/mimeapps.list:
[Default Applications]
x-scheme-handler/mailto=firefox-esr.desktop

Only after this manual intervention Gnome accepted Firefox as a mail app.

Reported to Firefox Bugzilla too:
https://bugzilla.mozilla.org/show_bug.cgi?id=1839244