Block JavaScript on Some Sites to Prevent Annoying Email Tracking
JavaScript is one of the key elements that most websites and web applications run on, but it is also one of the most easily used. Not only is it used in analytics tools, advertising and browsing trackers , hackers often use JavaScript to deploy malware , it makes it easy to track you in some circumstances, and it can even accidentally leak important data.
In fact, a recent study found that popular websites using JavaScript sent over a million emails to advertisers and other analytics companies in 2020 alone. The list of sites includes The Washington Post, Mailchimp, Wish, and even the recently launched video streaming service Quibi . Even worse, many of these websites did so unintentionally and even undermined other security measures they had that were supposed to keep users’ data safe.
Should you just turn off JavaScript in your browser?
You may not have to. Some browsers and privacy add-ons completely block JavaScipt from running by default, while most other modern browsers include options to restrict or prevent JavaScript when requested by the user.
While disabling all JavaScript completely will theoretically prevent data leaks and potential malware attacks that use JavaScript, it will also make it difficult to use many websites, or even prevent them from completely loading, such as Google Maps.
Fortunately, there is an intermediate approach here, which is to manually allow JavaScript to run only on certain websites and block JavaScript from running when you are unsure.
How to change JavaScript settings in your browser
Not all browsers have the same JavaScript settings, so the exact options available to you will differ depending on which one you use.
Some privacy-focused browsers like Brave will ask you if you want to run JavaScript on a new page load, while Tor blocks all JavaScript by default, no exceptions.
However, for most other browsers, you will need to manually change your JavaScript settings.
Chromium
- Open the url
chrome://settings/content/javascript
- Uncheck Allowed to block all JavaScript.
- You can add websites to block / allow lists to create exceptions from your current settings.
- Exit and restart Chrome.
Edge
- Navigate to
edge://settings/content/javascript
using the url string. - Uncheck the Allowed radio button to block all Javascript.
- You can then add specific websites to block / permission lists to create exceptions for your current settings.
- You need to restart Edge for the settings to take effect.
Fire fox
- In Firefox go to
about:config
- If you receive a warning message that this may void your warranty, please ignore it and click “I accept the risk” to continue.
- Use the search bar to find
javascript.enabled
- Double click javascript.enabled to mark it as disabled to disable all JavaScript.
- Restart Firefox.
If you don’t want to disable JavaScript entirely, you can use a Firefox add-on like Disable JavaScript to allow / block certain websites when they load.
Opera
- Use the URl panel to open
opera://settings/content/javascript
- Disable “Allow” to disable JavaScript for all websites.
- Websites can be added to block / permission lists to create exceptions from your current settings.
- Close and restart Opera for the changes to take effect.
Safari
- Open Safari
- Go to Settings> Security.
- Uncheck the box next to Enable JavaScript.
- Close the menu and restart Safari.
Vivaldi
Vivaldi doesn’t have a dedicated JavaScript setting and only lets you block JavaScript for every page.
- Click the Site Information padlock icon on the left side of the URL bar, then click Site Settings.
- Scroll down until you find the JavaScript option, then select Block from the drop-down menu on the right. Repeat as needed for each site where you want to block JavaScript.