How do I change Firefox to highlight "save as" or "open with" by default on the download dialog?
You cannot set the dialog box to appear but for a certain radio button to be checked. You can only change the default option.
You can do this within Options > Applications and then searching by the file type. See below:
The default actions are determined via the file MimeTypes.rdf, so this file is the one that you should modify once to suite your preferences, then copy to new installations.
Here is an extract from the documentation :
Attributes
General
- RDF:about - identifier
- NC:description - the name of the file type that will be displayed on the download prompt
Choosing what to handle
- NC:fileExtension - file extensions to handle (note that content downloaded from the Internet will go by MIME type, not by file extension)
- NC:value - MIME type to handle
Choose how to handle it (absence of the following options means "download to disk")
- NC:path - path of the application to use to open this file
- NC:useSystemDefault - true (use the system default for this MIME type) or false (define a different action)
- NC:saveToDisk - true (default action is "download to disk") or false (don't download by default)
Additional options
- NC:alwaysAsk - true (always ask which action to perform) or false (don't ask which action to perform)
- NC:editable - true (entry can be modified with user interface) or false (entry is locked)
- NC:prettyName - the short (display) name of the application
The file should be placed in the Profile folder that is suitable for the operating system and distribution and Firefox version (or fork) that you are using.
The dialog itself will appear with the choices as determined by these settings, or you can set it to automatically execute.
Please note that if you use the same profile on all computers, then Firefox Sync is also a solution.
Although the answer of @harrymc points to the right document, it doesn't say precisely which settings need to be changed and how to fix this.
As pointed out by @crazypotato, Firefox should normally rembember the last option selected and preselect that in the dialog window. On one of my computers this worked fine, on another it did not.
To solve the issue there, I had to modify the file mimeTypes.rdf
: in the RDF:Description
entry with attribute RDF:about="urn:mimetype:handler:application/pdf"
I added the attributes
NC:useSystemDefault="true"
NC:saveToDisk="false"
and changed NC:handleInternal
to false
. I'm not sure if all of these changes were necessary.
Note that it doesn't seem possible to actually fix a preselection: firefox will always remember your last choice (per file type), even if you set NC:editable="false"
.