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.
- Cookie AutoDelete
- Decentraleyes
- Disconnect
- Firefox Multi-Account Containers
- firewall
- HTTPS Everywhere
- IDN-Warner
- Privacy Possum
- Request Control
- Skip Redirect
- Temporary Containers
- uBlock Origin
- uMatrix
- Violentmonkey
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:
-
The script takes one mandatory argument and four optional arguments. The mandatory argument is the path to a .private file. More information on this below. The optional arguments come before the mandatory argument and are as follows:
- -p is the path to an existing firefox profile, which will be used under certain circumstances.
- -t enables the creation of a temporary profile.
- -c tells the script to copy certain files from the existing profile to the temporary one.
- -n tells the script to create a network namespace based on the specified interface.
- The .private file is a series of variables which customize the script. There is an example file located in my firejail-profiles repo and there is more extensive discussion of what this kind of file entails in the repo's README.
- If you just want to launch an existing firefox profile, simply provide the path to the profile with -p.
- If you want to create a private profile from scratch (i.e. without copying files from an existing profile), simply pass -t.
- If you want to create a private profile and copy over files from an existing profile, provide the path to that profile with -p and pass -t and -c.
-
If you want to disable the generation of a
private-lib
filter, simply set $PRIVLIB to 0 in firefox.private. -
If you want to disable the use of systemd, simply set $USE_SYSTEMD to 0 in
firefox.private
.
So there you have it! Creating ephemeral firefox profiles on linux is fairly easy.