Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1445  / 3 Years ago, sun, july 18, 2021, 3:28:03

Firefox determines which program to use to open a download based on the download's MIME type. More information on that can be found in Mozilla's online documentation.



It seems to me that when Firefox encounters a MIME type it has no configuration for, it prompts the user to open it in Gedit. Why Gedit? How can I change the default for unrecognised MIME types to gnome-open?


More From » firefox

 Answers
4

Introduction to the Content-Type header:



Every HTTP response contains a header named Content-Type, it contains the MIME type of the returned data stream. For example, the MIME type could be text/plain or text/html.



Servers are usually configured to set the Content-Type header to application/octet-stream when it can't determine itself what the file type of the download is. This is why you annoyingly don't get the correct suggestion on downloading new or non-universal file types, like .deb files.



Changing the default action for new and unrecognised MIME types:



For new and unrecognised MIME types, you can simply set the default action by ticking the "Do this automatically for files like this from now on" checkbox in the download prompt. The checkbox is disabled initially, but you can enable it by clicking the radio button next to "Open with" or changing the default application.



You'll be able to review your choices by opening the Applications tabs under Edit, Preferences.



Changing the default action for application/octet-stream:



For some reason, Firefox won't let you change the default action for application/octet-stream files. You will have to change the user's default handler for that MIME type, like this:




  1. Open ~/.local/share/applications/mimeapps.list.

  2. Find the line beginning with application/octet-stream= under [Added Associations]. If it's not there, create it.

  3. On the right hand side of the equals sign, put: gedit.desktop;, or whichever .desktop you want to use.



Changing the default action for application/octet-stream to gnome-open:



In my case, I want to default to gnome-open, but it doesn't have a pre-existing .desktop file, so I created one under ~/.local/share/applications/ with these contents:



[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=gnome-open %f
Name=gnome-open
Comment=Custom definition for gnome-open
NoDisplay=true

[#32661] Tuesday, July 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
intssive

Total Points: 493
Total Questions: 119
Total Answers: 101

Location: Liberia
Member since Mon, Feb 1, 2021
3 Years ago
intssive questions
Tue, Mar 21, 23, 08:19, 1 Year ago
Wed, Aug 31, 22, 04:04, 2 Years ago
Sat, Sep 25, 21, 15:09, 3 Years ago
Fri, Dec 31, 21, 09:13, 2 Years ago
;