Aspiring Software Engineer
Yet Another Firefox Hardening Guide
My guide to improving security and privacy in Firefox without sacrificing convenience.
Table of Contents
- Why not Google Chrome?
- Why hardening Firefox?
- Before you start
- Change Firefox Preferences
- Dive into advanced settings
- Install some add-ons
Why not Google Chrome?
Statistics clearly show that Google Chrome is the most popular browser, and it’s extremely fast and secure. However, Google collects a large amount of data and wants to know everything about you, which is why they’re dominating online advertising.
Chrome is also not completely open source. Even though Chrome is based on the Chromium open-source project, Google Chrome comes with proprietary components, such as the Chrome Cleanup Tool on Windows and the built-in updater.
Why hardening Firefox?
Even though Firefox is much better for your privacy than Google Chrome, it's not great out-of-the-box. By default, Firefox collects data via telemetry and crash reporting, and many privacy-enhancing features aren't enabled. By hardening Firefox, telemetry and crash reporting can be disabled, and online tracking can be mostly prevented. This way, there is much less chance for most websites to track you.
Before you start
- This guide is written for Firefox version 78 or newer.
- Update Firefox to the lastet stable version before you start. If you're using Firefox ESR, update Firefox to the latest ESR release.
- If you see an option that doesn't exist in your version of Firefox, just ignore it.
Change Firefox Preferences
To open the Firefox Preferences menu, open menu (top-right of browser window) and click "Preferences." Alternatively, enter
about:preferences into the address bar and hit enter.
Remove Pocket from your home page
Under Home > Firefox Home Content, UNCHECK Recommended by Pocket
Change your default search engine
I recommend DuckDuckGo as an alternative to Google, as it respects your privacy and doesn't track you.
If you'd like to use DuckDuckGo as your primary search engine, simply go to Search > Default search engine and change it to DuckDuckGo.
Enable Tracking Protection
Under Privacy & Security > Enhanced Tracking Protection, select Custom. CHECK all options and select All third-party cookies under Cookies. This may cause a small number of websites to break, but it's worth it for security and privacy.
If you encounter a website that doesn't function without third-party cookies (such as Microsoft Teams and Pearson MyLab), you may temporarily disable Firefox's Tracking Protection for that website. To do this, click on the Shield icon on the left of the address bar, and toggle off Enhanced Tracking Protection for this site.
Disable Password Saving
On the same page, under Logins and Passwords, UNCHECK Ask to save logins and passwords for websites. It's usually not a good idea to save passwords in your browser. You should use a password manager instead. For most people, I recommend Bitwarden.
Disable telemetry and error reporting
On the same page, UNCHECK EVERYTHING under Firefox Data Collection and Use.
Enable HTTPS-Only Mode
On the same page, under HTTPS-Only Mode, select Enable HTTPS-Only Mode in all windows.
HTTPS provides encrypted communication between your browser and websites, and you should always use HTTPS when available. With HTTPS-Only Mode enabled, Firefox will upgrade all connections to HTTPS, and you'll see a warning when a website doesn't support HTTPS.
Dive into advanced settings
To access these advanced settings, enter
about:config into the address bar and hit enter. When you see a warning screen, click I accept the risk to continue.
All configuration items are in alphabetical order, and easily searchable using the search bar on the top of the page. In this section, configuration items are
highlighted, and their values are in bold.
Double-click on a configuration item to modify it. If the item is a boolean, double-clicking it will change it from true to false, or vice versa. If the item is an integer or a string, double-clicking it will open a pop-up box to edit the value.
Making these changes disables Firefox telemetry:
- Delete the URL for
toolkit.telemetry.server, and leave it empty
If you don't use Pocket, or you don't want Firefox's Pocket integration, make the following changes:
To stop audio and video from automatically start playing, make the following changes:
WebRTC can potentially expose your real IP address, changing the following disables it:
Disable geolocation support
This prevents websites from accessing your location information. Change
geo.enabled to false.
Disable notification support
Web notifications are rarely useful and many find it annoying. To disable it completely, change
dom.webnotifications.enabled to false.
WebGL is used for some graphical web apps and online games, but it's also a security risk and can potentially be used for fingerprinting. Disable it by changing
webgl.disabled to true.
Even though prefetching may speed things up a bit, it may connect to servers without user intervention (which can be a privacy issue) and its performance benefits are minimal. Making these changes will disable prefetching:
Resist browser fingerprinting
This feature can decrease advertisers' and online trackers' ability to identify you. Change
privacy.resistFingerprinting to true.
Disable referrer headers
Referrers tell websites how you came to their sites, which can be used to track you. To prevent referrer headers from being sent, change
network.http.sendRefererHeader to 0.
Harden SSL preferences
Making these changes will disable insecure SSL ciphers and force safe negotiation:
Disable Firefox account features
If you don't want to sync your browser data with a Firefox account, you can simply use Firefox without signing in.
For those who want to completely disable this feature, change
identity.fxaccounts.enabled to false.
Change cookie behaviors
Websites often store a small amount of information, called "cookies," to store information (such as remembering login status and preferences) and track you.
Isolating cookies cookies and other stored information to the first party domain prevents cross-site tracking. To enable this feature, change
privacy.firstparty.isolate to true.
If you don't want websites to store any cookies at all, change
network.cookie.lifetimePolicy to 2. Firefox will automatically delete cookies at the end of browsing sessions.
WARNING: Doing this will sign you out of many websites when you close Firefox.
Install some add-ons
These add-ons require minimal configuration and can dramatically improve the security and privacy in Firefox. I recommend everyone install these extensions.
The most powerful open-source ad blocker, period. It can block ads, trackers, malwares, annoyances, and more. It also significantly improves page load speed.
If you want to customize it, please refer to the official wiki.
Decentraleyes prevents you against tracking though "free" CDN providers by serving common static files (such as the ones from Google Hosted Libraries) from your local device.
After you install it, you can just forget about it.
Privacy Settings creates a toolbar panel to alter Firefox's built-in privacy settings. Sometimes, you may have to disable some privacy protection for websites to function properly. When you finish using those websites, re-enable the privacy settings you just disabled for maximum privacy protection.
After installing, don't change any settings with it yet. Here are a few cases you might want to change your privacy settings:
network.peerConnectionEnabledto use real-time audio/video communication (Zoom, WebEx, Discord, etc.).
- Many web forms will not work when the browser isn't sending referrers. Enable
websites.referrersEnabledtemporarily to send referrers.
A password manager
If you already have a password manager, just install the add-on for it.
If you don't use a password manager, you really should consider using one. I recommend Bitwarden, which is 100% open source and very easy to use.
These add-ons are recommended for most users, but they require some configuration and maintenance.
This extension automatically deletes cookies and site data from closed tabs, which prevents most websites from tracking you with cookies. If you set Firefox to delete all cookies and site data on exit, you might not need this.
After installing, open its settings page from its toolbar icon. Once you're in there, check the box for Enable Automatic Cleaning and Enable Cleanup on Domain Change. Then, go to List of Expressions, and whitelist all websites that you wish to keep cookies for, including websites you want to stay logged in to and save preferences. In most cases, whitelisting the websites' domain (without
www) will do, but some websites have cookies associated with multiple domains, including:
- Microsoft: whitelist
login.live.comfor personal accounts; whitelist
login.microsoftonline.comfor work/school accounts
- Google: whitelist
- ProtonMail: whitelist
*.protonmail.comand check "Keep LocalStorage"
- Tutanota: whitelist
mail.tutanota.comand check "Keep LocalStorage"
- (11/10/2019) Added more settings and updated options for Firefox 70.
- (1/1/2020) Startpage is no longer recommended.
- (1/1/2020) Changed
media.autoplay.defaultto block autoplay for audio and video.
- (5/16/2020) Clarify instructions under Before you start
- (5/16/2020) Fixed broken link under uBlock Origin
- (5/16/2020) Added whitelisting instruction for Microsoft work/school accounts
- (12/23/2020) Refine wording throughout the article, and add information about third-party cookies.
- (12/23/2020) Added whitelisting instruction for ProtonMail and Tutanota
- (12/23/2020) Removed recommendation for HTTPS Everywhere, as Firefox 83 and later has HTTPS-Only Mode.
This article is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.