Firefox doesn't open log files as text when a non-text/plain mimetype is associated with them via handlers.json or the OS mimetypes associations
Categories
(Firefox :: File Handling, defect)
Tracking
()
People
(Reporter: philippb.ontour, Unassigned)
References
Details
Steps to reproduce:
Open a plain text file with ".log" extension (from www or local file)
Actual results:
An endless number of tabs opens, and as many 0-byte temp files are created
Expected results:
Text file is shown
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 2•2 years ago
|
||
This bug looks much related to 218257.
Looking at "about:preferences -> General -> Applications" I can see "application log" is a specific file type.
Other file types there have the option "Open in Firefox", which seems to Firefox-internal.
The log file type has instead "Use Firefox Web-Browser (default)", which looks as its system provided (Xubuntu 18).
It seems, the file open action is passed to the Desktop's file open action, then passed back to Firefox, then the filetype is detected again, resulting in a loop.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
could NOT reproduce on Windows 11, seems to be Linux-related
Comment 4•2 years ago
|
||
Yes, this is a known issue. The workaround would be to set the action for that filetype to "save to disk" or to manually associate a different helper application.
Reporter | ||
Comment 5•2 years ago
|
||
That answer is somewhat surprising. I don't think I am the only person that wants to view text (.log) files directly in the browser.
This is an essential part of my daily work flow working e.g. with Jira.
Comment 6•2 years ago
|
||
(In reply to philippb.ontour from comment #5)
So to be clear, I duped to the generic bug around these infinite loops for files that Firefox cannot open (though I have previously tried to fix this in bug 1750253, it depends on being able to determine we are the default application for the file, and for whatever reason it sounds like that is not happening here).
The generic solution to that problem is "don't make Firefox the default for files it cannot open". Like, people on Windows asking Firefox to open MS office documents or w/e just doesn't make too much sense.
I don't think I am the only person that wants to view text (.log) files directly in the browser.
This is an essential part of my daily work flow working e.g. with Jira.
If you're really saying "Firefox should be able to open .log files on my computer", that's a slightly different kettle of fish.
If the mimetype the OS gives us for this local file is not text/plain
, then how should the browser know it can open the file as text?
Does it work if you rename the file to .txt
, and/or edit your mime configuration so it doesn't use whatever magical mimetype it's using right now?
Reporter | ||
Comment 7•2 years ago
|
||
Thanks for clarification! I already wondered if this is related to my local mimetype setup. I will dig a bit deeper there.
Reporter | ||
Comment 8•2 years ago
|
||
Yes, it works if the file does not have an ending that matches anything in Settings->General->Applications.
Any hint how this list is populated would be much appreciated!
Comment 9•2 years ago
|
||
(In reply to philippb.ontour from comment #8)
Yes, it works if the file does not have an ending that matches anything in Settings->General->Applications.
Any hint how this list is populated would be much appreciated!
There's a local file in your profile called handlers.json
that has your locally saved associations (formed e.g. when previously downloading/opening files where we've asked what to do, or if you used the downloads panel context menu and said "always open files like this"). In terms of the mimetype to file extension associations, they come from your system's mime database (/etc/mime.types
on Linux, I believe, and possibly elsewhere on modern systems... I'm not a Linux expert).
Comment 10•2 years ago
|
||
The severity field is not set for this bug.
:Gijs, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 11•2 years ago
|
||
bug 196078 is the older bug to just render text/*
as text/plain
in general, which presumably would help here...
Description
•