6

No, I am not asking how to set a default application or action.

Now that I have that out of the way, I want to know how to determine the default selected radio button for the download dialog:

enter image description here

I would like PDF files to have "Open With" default pre-selected, and everything else to have "Save File" pre-selected. The important thing is that I still want the download dialog to appear, but I don't like how firefox automatically selects one radio button or another (seemingly at random). Someone posted exactly what I am asking for (in much more detail) here: https://support.mozilla.org/en-US/questions/958705#answer-434781

As far as I am aware, Firefox determines what radio button select, but this cannot be changed by the user...

  • I'd like to note that on different Linux distributions, the preselected radio button differs, so it seems there is some way to change the default. As a side note, I would actually prefer "open with" set as default. – Jaap Eldering Aug 20 '14 at 11:38
  • After "save file" or "open with" Firefox remember what you select and which type of file it was and use it for all future downloads(without selecting checkbox "Do this auto..."). I dont see point in this question. – crazypotato Aug 23 '14 at 7:54
  • @crazypotato: indeed I can confirm that on one of my computers, but this is definitely not the case on another. So this might actually be a bug. – Jaap Eldering Aug 23 '14 at 10:17
  • Then you should ask question about this "bug". – crazypotato Aug 23 '14 at 20:10
  • Wanna add this tip: You can use hotkeys for select radiobutton for example press alt+S for select save dialog. But this depends on language. – crazypotato Aug 23 '14 at 21:40
2
+200

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.

  • This doesn't seem to answer the question (please do read it carefully): the MimeTypes.rdf file basically stores the information that can be configured via edit->preferences->applications. The default action is already "always ask", but the question is how to change the preselected action in the dialog box that asks what to do. – Jaap Eldering Aug 23 '14 at 10:13
  • Yes it does answer the question, which was how to transfer default actions for multiple file-types without specifying each one again and again per each new installation. In addition, this is the only possible answer (except maybe some add-on I don't know). – harrymc Aug 23 '14 at 11:44
  • 1
    After looking into mimeTypes.pdf more closely, indeed this works; your answer wasn't very clear though about precisely which attributes have to be used here. Still, thanks, bounty awarded. If you edit your answer to clearly indicate which attributes to change, I'd be happy to change my downvote to an upvote. – Jaap Eldering Aug 23 '14 at 13:51
  • Done. I also added a note about Firefox Sync. – harrymc Aug 23 '14 at 14:40
  • 1
    @crazypotato: You are right about Firefox Portable, except that it might not be feasible across all platforms. MimeTypes.rdf is also portable, as is Firefox Sync. – harrymc Aug 24 '14 at 8:29
3

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:

enter image description here

2

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".

1

You can force the "Save File" dialogue box to always be displayed using HTML5:

Click <a href="blurb.doc" download>here</a> to download your file

This doesn't work on Internet Explorer. However in Firefox 30 the dialogue appears with the "Save File" option pre-selected.

I'm led to believe it will also work in Opera and Chrome.

  • 1
    I haven't tested this, but it would only work if you have control of the website from which you're downloading the file. Typcially you don't. – Jaap Eldering Aug 20 '14 at 11:36
  • Good point. The way the question was phrased meant I (possibly incorrectly) inferred that they had control. A greasemonkey script could change the code to do this, but it would only work if the file type could be inferred by the target URL - which isn't always the case. – Richard Aug 20 '14 at 21:38
  • Seems like something that would be possible using a userscript, though. Or an extension to listen for a modifier key on clicking a link. – joe Aug 21 '14 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.