Start Firefox with a temporary, throwaway session, with no add-ons

This is a handy trick for starting a new, temporary profile on Firefox on Linux to use websites that break when you block their privacy invasion.

I heavily lock down my Firefox settings to block trackers, isolate websites from loading third-party content and setting cookies, blocking supercookie techniques such as using the HTML canvas to store data, etc. (you can find out how to lock down your browser by searching for a guide, of which there are plenty). This protects my privacy but also breaks websites which only function by invading your privacy this way. For example, the Submit buttons on forms frequently disappear (no idea why forms seem to break so frequently when blocking stuff, but whatever).

I used to keep Chromium installed as a backup browser which I used only when forced by a broken website. However, with the way that Google are man-handling Chromium these days, forcing non-standard features down everyone's throats and generally trying to record as much of the user's interactions with the browser and websites as possible, I don't do this any more. For a while I have maintained a "throwaway" Firefox profile which doesn't contain any add-ons like uBlock Origin, Privacy Badger, HTTPS Everywhere, etc., and none of my modifications to about:config. This works well, but I need to ensure I open the private browser window to avoid tracking cookies being stored on my throwaway profile.

Today I learned a neat trick: add a bash alias to your .bashrc file that starts Firefox using a profile stored in your temporary directory:

# Temporary firefox throwaway session command.
alias firefox-throwaway="firefox -no-remote -profile $(mktemp -d)"

Just open up .bashrc in your home directory and add that command to the bottom. Reload the settings in the current terminal with source ~/.bashrc or open a new terminal, and you will now have the firefox-throwaway command available.

Note that if you use Firefox Nightly, like me, you have to substitute firefox in the above alias with firefox-trunk.

Now you can start Firefox in a temporary profile, which gets deleted when you restart your computer. You can happily accept cookies from stupid websites and have them automatically and safely wiped out later.