The download dialog for Firefox shows two options: "Save file" and "Open with".
By choosing "open with", Firefox downloads the file to a temp folder and opens the associated application. I want to prevent this behavior.
I made my homework and searched the MozillaZine, and the Knowledge Base (like here, here or here) and if I understood correctly, the download dialog box will depend not on the file's extension, but rather on its mime type.
I know I can set the behavior by going to Preferences > Applications, like this:
What I need is a way to (preferably) make it impossible to open with an external application, or at least to force the file to be saved.
I know I can set browser.altClickSave in about:config to have it save the file when I click pressing ALT, but I need some solution that does not require user interaction.
That Brazilian Guy asked Dec 5, 2014 at 1:53 That Brazilian Guy That Brazilian Guy 7,025 11 11 gold badges 66 66 silver badges 104 104 bronze badges Commented Dec 5, 2014 at 3:11Automate what operations? It's just a click to download. My question was long because I wanted to provide enough info. Besides, if users can't be bothered (or can't understand what happens) to click download instead of open with, then certainly a more complex solution won't work. I need something that does not require user interaction
Commented Dec 5, 2014 at 9:50 So you need a computer with no computer user. OK. :) Commented Dec 5, 2014 at 13:14You can just modify the incoming MIME type with one of several extensions. Set it to a MIME type that is always downloaded. Sorry, not enough time right now for a full answer, but you are smart enough to get the idea.
Commented Dec 12, 2014 at 5:53I am trying to download all (even unknown mimetype) files without prompt, it seems impossible with Firefox! I need behavior like Alt-Click to be default.
Commented Jan 10, 2016 at 7:01Making a master mimeTypes.rdf file that you deploy to users is the best solution
Open mimeTypes.rdf in an editor that handles XML style docs well (such as Notepad++)
Find and replace first line with second:
NC:saveToDisk="false" NC:saveToDisk="true" and NC:alwaysAsk="true" NC:alwaysAsk="false"
I would also "seed" your master mimeTypes.rdf with some of the exotics your users have accumulated:
find " MasterMimes.txt #generate list of mimetypes find " )" data-controller="se-share-sheet" data-se-share-sheet-title="Share a link to this answer" data-se-share-sheet-subtitle="" data-se-share-sheet-post-type="answer" data-se-share-sheet-social="facebook twitter " data-se-share-sheet-location="2" data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f" data-se-share-sheet-license-name="CC BY-SA 3.0" data-s-popover-placement="bottom-start">Share)" title="">Improve this answeranswered Dec 8, 2014 at 17:10 retriever123retriever1231851 silver badge7 bronze badges1- 3Unfortunately, that is not practical at all. I have no idea what types I will download in the future. Also, some file-types (like exes) don't work at all.– SynetechCommentedNov 4, 2017 at 17:44
Add a comment|3In about:config
there is now an option browser.download.forbid_open_with
. Just set it to true
)" data-controller="se-share-sheet" data-se-share-sheet-title="Share a link to this answer" data-se-share-sheet-subtitle="" data-se-share-sheet-post-type="answer" data-se-share-sheet-social="facebook twitter " data-se-share-sheet-location="2" data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f" data-se-share-sheet-license-name="CC BY-SA 4.0" data-s-popover-placement="bottom-start">Share)" title="">Improve this answer)">edited Apr 30, 2021 at 15:58answered Dec 4, 2020 at 10:07 PqqwetiqePqqwetiqe1891 silver badge7 bronze badgesAdd a comment|0NOTE: The instructions are Windows specific, but will work for other OSes. This solution will not work for PDFs without disabling PDF.js and/or other PDF viewer plugins. It also won't work for files which Firefox can open directly (e.g. MP3 files, images, videos, text/plain
files, etc.)
Well, this solution isn't as user interaction free as you'd want, but if you have the ability to provide customized versions of Firefox or you can run batch scripts on each user's computer, you can try this:
Install the latest beta version of Automatic Save Folder (ASF)
Create a filter to match any kind of file from any domain like this.
Also make sure you read the 1st Install Guide
Configure ASF to automatically choose Save File
from the Save dialog 
Install FEBE and backup the browser profile (including preferences) and restore them on individual computers
Or, if you can run batch scripts on the user's computer, run the following script (after ASF is installed):
Filename: Configure ASF.bat @ECHO OFF :: Kill Firefox if it is running or else prefs.js won't be updated START "" /WAIT /B "taskkill" /F /IM firefox.exe :: Find out the user profile directory for Firefox and navigate to it SET ProfileDir=%APPDATA%\Mozilla\Firefox\Profiles CD /D %ProfileDir% FOR /F "tokens=* USEBACKQ" %%F IN (`dir /A:D /B ^| find "default"`) DO ( SET "ProfileDir=%ProfileDir%\%%F" ) CD /D %ProfileDir% :: Read ASF preferences from 'extpref.txt' and append them to Firefox's preferences file TYPE %~dp0%\extpref.txt >> prefs.js :: Since the username for each user is bound to change, find out the path to the "Downloads" :: folder and append it to prefs.js SET DownloadsDir=%USERPROFILE%\Downloads ECHO user_pref("extensions.asf.filters0.folder", "%DownloadsDir:\=\\%"); >> prefs.js ECHO user_pref("extensions.asf.lastpath", "%DownloadsDir:\=\\%"); >> prefs.js PAUSE
Filename: extpref.txt user_pref("extensions.asf.dialogForceRadio", true); user_pref("extensions.asf.dialogaccept", true); user_pref("extensions.asf.filters0.active", true); user_pref("extensions.asf.filters0.domain", "*"); user_pref("extensions.asf.filters0.domain_regexp", false); user_pref("extensions.asf.filters0.filename", "*"); user_pref("extensions.asf.filters0.filename_regexp", false); user_pref("extensions.asf.filtersNumber", 1); user_pref("extensions.asf.tempdomain", "http://chrisblattman.com"); user_pref("extensions.asf.useDownloadDir", true); user_pref("extensions.asf.version", "1.0.5bRev128"); user_pref("extensions.asf.viewdloption", true); user_pref("extensions.asf.viewpathselect", true); user_pref("[email protected]", true);
The script takes input from extpref.txt which should be present in the same folder as the script itself and must contain preferences for ASF, which will be updated in Firefox's preferences file (prefs.js)
You can read the preferences from about:config under extensions.asf.* or simply get them from prefs.js which will typically be in the folder:
%APPDATA%\Mozilla\Firefox\Profiles\. default\
When creating extpref.txt make sure you don't include extensions.asf.filters0.folder and extensions.asf.lastpath since they will be different for each user.