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

Popularity: 77% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

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

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

5 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!

  5. Michael said

    Firefox does know whether you chose to open the file or to save it to disk. On systems other than OS X, if you open a downloaded file instead of saving it, it puts the file in a temporary folder. The contents of that folder get deleted on reboot.

    I looked at the Firefox source code, and some cretin thought we Mac users wanted it to work differently than it does on Windows and Linux. He was wrong.

    All it would take to fix this is to delete about 50 lines of special source code written just to break the Mac. I tried to do that on my own machine, but I couldn’t figure out how to rebuild FF.

    Actually it should be a simple about:config variable that says where it gets saved, so you can put it in a different temporary folder for each user.

    This complaint has been around for years, and Mozilla still hasn’t fixed it.

    BTW, getting it to download to a download folder instead of the Desktop is a simple Preferences setting. The issue is to get Open With to use a different folder than Save.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.


Bad Behavior has blocked 370 access attempts in the last 7 days.

ZagZ.com :: Deep end of the alphabet with Paul Zagoridis is Digg proof thanks to caching by WP Super Cache