Mozilla should follow shared mime freedesktop specs (determining MIME type of a file and the default app for it)
Categories
(Firefox :: File Handling, enhancement)
Tracking
()
People
(Reporter: tmpfreire, Unassigned)
References
(Depends on 1 open bug)
Details
(Keywords: helpwanted)
Comment 1•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
Comment 3•19 years ago
|
||
Reporter | ||
Comment 4•19 years ago
|
||
Comment 5•19 years ago
|
||
Updated•19 years ago
|
Comment 6•19 years ago
|
||
Comment 7•19 years ago
|
||
Comment 9•17 years ago
|
||
Comment 10•16 years ago
|
||
Updated•16 years ago
|
Comment 12•16 years ago
|
||
Comment 13•14 years ago
|
||
Comment 14•14 years ago
|
||
Comment 15•14 years ago
|
||
Comment 16•14 years ago
|
||
Comment 17•14 years ago
|
||
Comment 18•14 years ago
|
||
Comment 19•14 years ago
|
||
Comment 20•12 years ago
|
||
Updated•9 years ago
|
Comment 21•5 years ago
|
||
So there’s three options, depending on GIO being supposed to behave according to spec or not:
If GIO wants to be spec-compliant, but isn’t, GIO needs to be fixed.
If GIO is spec-compliant, Firefox uses it wrong and needs to be fixed.
If GIO is intentionally not spec-compliant, Firefox needs to start using something compliant instead.
Who is familiar with the code and can answer which one it is?
Comment 22•5 years ago
|
||
I don't think there is anyone in particular familiar with both the Firefox-side code and GIO.
Also, it's not clear to me which "spec" is being referenced in comment 21. The freedesktop spec? Web specs? Something else?
Comment 23•5 years ago
|
||
I'm unaware of a web spec for opening files, and this ticket literally has in the title "follow shared mime freedesktop specs", so it seems obvious that is the spec being referred to.
Comment 24•5 years ago
|
||
exactly.
I investigated a bit: In my case I didn’t set any default application for the .docx mime type.
Firefox opended it with Calibre’s ebook Editor, while everything else agrees to use Libreoffice Writer.
I turned to xdg-mime
as a source of truth. It is pretty complex: For my KDE Plasma desktop it internally uses ktraderclient5
which makes it of course act the same as KDE, and gives us Libreoffice Writer for a .docx file:
$ xdg-mime query default application/vnd.openxmlformats-officedocument.wordprocessingml.document
libreoffice-writer.desktop
Firefox starts Calibre’s ebook Editor, which might indicate that its method (GIO?) seems to simply use the first entry in /usr/share/applications/mimeinfo.cache
(that file is for knowing what choices are there, not what to use):
$ grep ml.doc /usr/share/applications/mimeinfo.cache
application/vnd.openxmlformats-officedocument.wordprocessingml.document=calibre-ebook-edit.desktop;calibre-ebook-viewer.desktop;calibre-gui.desktop;libreoffice-writer.desktop;
After manually changing the default to Writer manually in ~/.config/mimeapps.list
, Firefox agrees with xdg-mime and KDE.
I didn’t figure out what the spec says for choosing the default application if none is set. It might be that Firefox’/GIO’s behavior is therefore already spec compliant here.
In any case we would get better and more expected results if Firefox used xdg-mime
if available to determine the default.
Comment 25•4 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky] from comment #22)
I don't think there is anyone in particular familiar with both the Firefox-side code and GIO.
Also, it's not clear to me which "spec" is being referenced in comment 21. The freedesktop spec? Web specs? Something else?
https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s02.html
Updated•2 years ago
|
Comment 26•2 years ago
|
||
Maybe I am naive, but would it just suffice to have Firefox run xdg-open $fileName
for all files for which it is set to use the system default application and when xdg-open
is available ?
Comment 27•1 year ago
|
||
Following the Arch Wiki (Firefox page and XDG Mime page), the problem can be solved partially setting to 1
the widget.use-xdg-desktop-portal.mime-handler
preference in about:config
and using a softlink:
ln -s ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list
Comment 28•1 year ago
|
||
(In reply to Daniele Basso from comment #27)
Following the Arch Wiki (Firefox page and XDG Mime page), the problem can be solved partially setting to
1
thewidget.use-xdg-desktop-portal.mime-handler
preference inabout:config
[...]
In Debian with the FVWM window manager (no desktop environment), setting this pref to 1 switches the (incorrect) default application to "System Handler (default)", which does nothing.
FYI, for application/pdf
, Firefox chooses "Inkscape (default)" (which I never use for PDF files as it is not a PDF viewer) while I currently have:
cventin% xdg-mime query default application/pdf
xpdf.desktop
Description
•