Tuesday 18 September 2007

Firefox Files (Crap) on the Desktop on OSX

When you use Firefox and OSX, you will come to realise a VERY annoying feature / quirk of it's file management.

If I download a file, I can choose where it goes (change preferences to set this feature) and that is all good, however, if I click on, say a PDF, to view it (and say "Open with Preview") then the file is downloaded, wait .. on my desktop, and left there. After sometime, you will notice a heck load of files that you have viewed, Excel Spreadsheets, PDFs, word documents, mp3 etc. and they just make a mess of what is supposed to be a clean machine (clean lines, clean desktop :-).

So there are two solutions to this problem.

1. Changing the directory

Firefox saves these files based on the "setting" in Safari about where files get downloaded to.
So the quick fix here is to open up Safari (never used it, except for downloading firefox :-). Go to preferences, go to the General tab and change the download directory to somewhere other than the Desktop.

Now, I actually changed it to /tmp/ (I actually have a sym link in my home directory for tmp (always have done this) .. so firrefox now dumps all these "saved" files, to /tmp/ and /tmp gets purged every shutdown/reboot.. yay! No more mess.

You could of course, make a directory in ~/ called Downloads, and then you can peruse and remove at your leisure. Might be handy to do that when you needed to "review" a file you viewed whilst "online".

2. Tell Firefox to delete these files when it shuts down
In firefox about:config, you need to add a new config parameter that tells firefox to remove these files when it shuts down.
The key is app.helperApps.deleteTempFileOnExit and needs to be a boolean.

I haven't tried this way, but don't like it much because it means, if firefox crashes, or the mac crashes, firefox won't delete the files for that session. And also, my firefox is often open for weeks at a time, never closed, so the files will still grow in number.

Of course, you could combine the 2.

Current 5 booksmarks @ del.icio.us/pefdus