Firefox stores temporary PDFs in ~/Downloads instead of /tmp

While I have Leap 15.6 as tag, this already was emerging in 15.5.

I have Firefox configured to ask what to do with PDFs and when I choose Open with Ocular, Firefox has of course to store the PDF temporary somewhere on the system and then start Ocular on it. Earlier the PDFs were stored somewhere in /tmp (a username subdirectory I assume), with the result that they were removed when /tmp was cleared at each shutdown/boot cycle (/tmp being a tmpfs).

Since some version of Firefox (maybe even more then a year ago) this was changed in storing the PDF in ~/Downloads , which I only detected by incident because they heaped up there. I almost never look there because I almost never use it. Now I have to clean up ~/Downloads on a regular base and that annoys me.

Does anyone know if this is something that can be set, e.g. some parameter in about:config. I looked there but could not find it.

Second reply here?
https://www.reddit.com/r/firefox/comments/11n669b/firefox_not_using_temporary_files_folder_anymore/

1 Like

In about:config
Look up browser.download.start_downloads_in_tmp_dir and set it to true.

Just set it and will see (and test) what happens.

Thanks for finding this.

It helps! Just openend a PDF shown in FF with Ocular. It is NOT in ~/Download, but

henk@boven:~> l /tmp/mozilla_henk0/
total 36
drwx------  2 henk wij     60 Mar  8 15:32 ./
drwxrwxrwt 17 root root   400 Mar  8 15:33 ../
-rw-r--r--  1 henk wij  33195 Mar  8 15:32 kernel.pdf
henk@boven:~> 

I will go and “force” my other users to use it also. :wink:

1 Like

Go away from Firefox configuration by about:config and learn to work with about:policies.

https://support.mozilla.org/en-US/kb/managing-policies-linux-desktops

about:policies#documentation

https://github.com/mozilla/policy-templates/releases

# more /usr/lib64/firefox/distribution/policies.json |grep -i downloaddir
    "DefaultDownloadDirectory": "/tmp",

That is not the same thing AFAICS. It defines the Download dir, not the temporary one for f.e. PDFs. Also, you refer to a package owned file, which should never ever be edited. An update would overwrite the changes.

Policy can be in /etc/firefox/policies and there is StartDownloadsInTempDirectory policy item.

In this case having it in a /etc/ directory (and the more in /usr/lib/ might be right to force it on all users, but in general Firefox settings are user preferences in my opinion.

1 Like

I agree to that.

As @knurpht stated, I agree!

If running FF on a “user system”, using FF app specific settings is less complicated and easier to modify.

The suggestion to use policies is more for using FF in corporate scenarios, to be maintained by corporate admins.

And hey, the accepted solution happened for Reply 1 :+1:

You can create a file named user.js with

user_pref("browser.download.start_downloads_in_tmp_dir", true);

and put it in any profile (/home/USER/.mozilla/firefox/PROFILEDIRECTORY/) where this condition should be enforced.

Once AGAIN … why are folks wanting to complicate configuring this option (?). Folks are probably misunderstanding.

Go back and read Reply #1,2,3.

WHY create a new .js file, then copy it to a specific sub-dir … when the config option is available while running in FF. LESS involved and way easier.

1 Like

I fully agree @myswtest . $Joe_Average should not have to edit (new) files in a terminal when it can be done from the application

  1. A user.js file can be created with any editor (no need to use the console).

  2. user.js files are for people who manage/use several firefox instances. I use them because I customize firefox quite heavily (see GitHub - arkenfox/user.js: Firefox privacy, security and anti-tracking: a comprehensive user.js template for configuration and hardening). They allow me to move my individual customization (e.g. print output, security options, etc.) to any firefox I use.

Well, that is what I actually did (but did you as well?).

If @hcvv wants “to force this option on to his other users” the a user.js file is a way to go.

Sorry, you missed the “” around “force”. And maybe I should not have shortened my intentions so much.

I will point them to the fact that they may litter their /Downloads directory and what can be done about it. I probably will offer to do the setting before their eyes. More nudging then forcing.

For most users the Settings from the main menu is already something and the about:config is already scaring. Let alone that creating those config files is something that should be in their toolkit. They may of course, it is their user.

And indeed I already declared the case solved from post #3 or #4.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.