Temporary folder for Firefox and Thunderbird on OS X

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.