Temporary folder for Firefox and Thunderbird on OS X
Published May 22, 2008 | #92 | RSS | Trackback
In February last year I bought my first MacBook with OS X 10.4 alias Tiger installed and I was happy to say “Hello” to the Apple folks. Ever since it was a bit of work and I had to learn a lot until everything worked like expected. But there is still one thing which bugs me when running Firefox or Thunderbird on a fresh OS X installation. Both applications don’t use a reasonable temporary folder. Instead files which are opened by helper applications are stored under ~/Desktop or ~/Download and will not be removed sometimes after Firefox or Thunderbird are closed. This results in a really cluttered desktop or download folder. All the following steps have to be done because there is no way to specify the temporary folder from within Firefox and Thunderbird. Both lack an UI or a hidden preference to change this folder. I cannot say when this will be changed, but there is a reported bug about this issue. But lets go on…
As a circumvention it was possible to use Safari and change its download folder to the specified location. From now on Firefox and Thunderbird are using this folder to store the temporary files. It’s not the best solution but I’m fine with that because I do not use Safari and I’m not interested in its download folder. But with the release of Safari 3 this isn’t possible anymore. The newer versions are using an other way to store its download folder settings and don’t touch ~/Library/Preferences/com.apple.internetconfig.plist anymore. So how it can be easily changed without using a plist or hex editor?
It’s just easy. Download one of the former versions of Safari and use it to change the download folder. There is a project called Multi-Safari which gives you the possibility to run different versions of Safari in parallel. So grab the latest Safari 2 release, open the preferences, and select another download folder location. It looks like that the best solution is to use ~/Library/Caches/TemporaryItems (NS_OS_TEMP_DIR) where all contained files will be deleted on restart. If you want to have the files deleted on exit of Firefox or Thunderbird you can also add the preference browser.helperApps.deleteTempFileOnExit and set its value to true. That’s all.
Please remember that this is just a workaround. It would be nice to see bug 311292 fixed in a timely manner.

There’s a hidden preference to clean up the temp files on exit.
Yes, that’s the one I mentioned in my post. But it’s not working at all. Probably if you are using hibernation mode temporary files are getting lost after wake-up and closing Firefox. I’ll have a look at this part within the next days again.
This is great. Thanks much for posting - I was going crazy trying to figure something out to reduce the clutter.
A quick (unrelated) question since you are a Mozilla + Mac OS X user. I’m having trouble opening Office 08 attachments using Thunderbird. The app opens ok when I double-click attachment, but with a blank (or no) doc/spreadsheet/presentation.
A strange file named “dftmpOJLFOFEMlkkkkkkk——–” labeled as text, but not openable using TextEdit also appears with every download.
Any ideas? Would greatly appreciate feedback (if any).
Arnav, we should discuss it outside of this blog post. You can just give me a reply via mail.
Hi there!
Thank you for the workaround. I was able to download safari 2.0.4 and change the download directory to a temp directory without issue. Why they make the default behavior to save PDFs to the desktop is absolutely beyond me. If I want to save the PDF to my desktop, I will click SAVE. (what a novel concept!)
Thanks again!
- IPv6Freely
There is some ongoing work and it will hopefully get fixed in the near future. Sorry that I cannot give more information about. But this issue still needs someone who is willed to fix. Any contribution is highly welcome!