Skip to content


PDF files left by Firefox on Mac OS X Desktop

Or: How To Auto-Delete Temporary Files abandoned by Mozilla apps on your Mac OS X Desktop.

Firefox on Mac OS X does not clean up temporary files in the same way as the Windows version. When you right-click a PDF file and view it (instead of save) Firefox downloads it and then runs the browser helper application. Firefox has no way of knowing when you’ve finished with the file, so by design it does not delete it.

This can leave your desktop cluttered with PDF files and other assorted detritus of the web.

The location for saving temporary files from the Open with command is set by your Safari preferences on the General tab. Change Save downloaded files to… and pick something like Documents | Downloads | Temp. Firefox will now download files there with you chose Open with instead of Save. Your default Save location is still set in Firefox preferences.

Thunderbird also displays this behaviour.

The fix is

  1. Go the the URL about:config (type it in the address line of Firefox)
  2. Right/Control-click anywhere on the page and select New > Boolean from the context menu
  3. Type or paste browser.helperApps.deleteTempFileOnExit as the preference name in the dialog box that pops up and select True for the value

Firefox will now automatically delete these Temp files when it exits.

For Thunderbird get to the config editor via Thunderbird > Preferences… > General > Config Editor… and add the same Boolean preference

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Posted in Mac, Technology. Tagged with , , , , , .

4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. kris said

    Thanks, this was very helpful. My wife’s mac is cluttered with a neverending pile of garbage from firefox. This might just take care of it.

  2. Matt said

    That was very helpful, just what I was looking for… and other sites didn’t seem to have a fix that actually worked. This is probably obvious, but note that you’ll still see the files on your desktop temporarily, even if you exit the PDF viewer — it’s not until Firefox exits that they get deleted. Thanks so much.

  3. You’re welcome. Thanks for the note.

    @Maff yes the files stick around until you close Firefox. That’s why I recommend setting a temporary directory so they don’t clutter the desktop. Actually that’s how it’s designed, because Firefox has no way of knowing when you’re finished with the file so it keeps it until you close firefox, then it clears the temporary directory.

  4. John said

    I followed your instructions for changing the “Save downloaded files to:” in Safari, but it hasn’t made a difference in where either Firefox or Thunderbird save the temporary files. You advice on adding the config entry for deleteTempFileOnExit works great, however. And since the Mozilla apps seem to prevent name collision, I shouldn’t have to worry about it deleting something I want to keep. So at this point, it’s gone from a major hassle to a minor annoyance.

    THANKS!

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.