Firefox Tips and Tricks

Firefox 57 will invalidate many of the existing useful extensions (like FaviconizeTab, which was a personal favorite). Some will see replacements. Others, however, can be replicated by existing customization options, albeit well-hidden ones.

Setup

In order for many of these tricks to be useful, you will need to create a file called userChrome.css. First, find your profile folder by going to about:support and clicking on Open Directory next to Profile Directory under Application Basics. Then, navigate to the chrome directory and copy the userChrome-example.css file to userChrome.css. Now open the file in your favorite text editor.

Disabling the cache

For privacy reasons, it can be beneficial to disable the cache in Firefox (cache-based tracking is very much a thing). There are three separate caches: memory, disk, and offline (also appcache, but I have no idea what that does...). Disabling the disk and memory cache are easy: simply toggle browser.cache.disk.enable and browser.cache.memory.enable. Disabling the offline cache in Firefox, however, can break some things in about:preferences#privacy (namely, the "Cookies and Site Data" part, which will hang on "Calculating size..."). The fix for this is to leave the offline cache enabled within Firefox but disable writing to the relevant directory. On Linux, this is done using chmod u-w. To find the offline cache directory, look for "Local Directory" in about:profiles or look for the disk location in about:cache. On Linux, this is usually under ~/.cache/mozilla/firefox/<profile>. You should disable writing to the OfflineCache directory, which should effectively disable the offline cache without breaking Firefox. If Firefox is still doing memory caching even after toggling browser.cache.memory.enable, you should be able to set the pref browser.cache.memory.capacity to 0 (you'll have to right-click and create a new Integer preference) with no ill effects.

Side note: You can check to see if things are being cached by opening the "Network" tool (under the "Web Development" submenu) and reloading the page. If anything shows up as "cached" in the output, you know that some cache is still working (it also doesn't necessarily show up in about:cache, which is very confusing...).

Reducing the width of your non-pinned tabs

Before Firefox 57, there were some addons that would reduce the size of your tabs (e.g. FaviconizeTab). If you want to replicate this, add this at the bottom of userChrome.css:

Hiding the close button on non-pinned tabs

With all the different ways to close tabs, from keyboard shortcuts to mouse shortcuts, who needs the close button to appear on the tab?

Hide back and forward buttons

If you have other ways of navigating the web and don't need to see the back and forward buttons (that is, they're just taking up valuable screen real estate), you can hide them like this:

Disabling Pocket completely

If you prefer to not use Pocket at all and wipe all traces of it from your browser, simply go to about:config and set extensions.pocket.enabled to false.

Privacy on Firefox

This part and the next one are more about protecting your privacy. I use the following set of extensions to help protect my privacy on the web.

Ephemeral profiles

Having truly temporary profiles which only last as long as the session is a great way to preserve privacy. And, with a little bit of work, you can ensure things like settings get copied over. Here, I provide a Linux-specific script which sets up a temporary firefox profile and runs it with the sandboxing tool firejail. You can find the script at my firejail-profiles repo. The way it works is as follows:

So there you have it! Creating ephemeral firefox profiles on linux is fairly easy.