Does disabling JavaScript protect you from hackers?

JavaScript is responsible for many elements in a web page. When you read this on any mobile or desktop browser, it most likely supports loading JavaScript to help you navigate the web. Some popular examples include Twitter, GitHub, Trello, and countless others. Exceptions may include text web pages without dynamic resources and regular HTML web sites.


Since the majority of the web uses JavaScript to display image galleries, advertisements, pop-ups, interactive menus, maps, web apps, etc., how can disabling JavaScript really protect you from pirates?

What does disabling JavaScript do?

JavaScript is an online scripting language widely used by websites.

Nevertheless, there are various extensions and privacy options available in the browser (Chrome, Firefox, Safari, etc.) to disable JavaScript. This makes it easy to disable (and enable) JavaScript.

But, when you turn it off, what really happens? Some scenarios include:

  • You get a cleaner reading experience, removing annoying pop-ups and ads (varies by website).
  • It blocks several elements on websites that include tracking cookies, improving your privacy.
  • Disabling JavaScript can also break websites, affecting user experience.
  • It eliminates the possibility of a hacker injecting malicious code into the web page you are browsing.

In a nutshell, disabling JavaScript makes the browsing experience safer, but it also comes at a cost to the user experience.

If you’re having trouble navigating a website and you find faulty elements, it’s probably because you have JavaScript disabled for the webpage.

Does blocking JavaScript protect you from hackers?

Yes and no.

A hacker cannot trick you into loading malicious scripts from the web page you are visiting because you have already blocked it. If you do not apply the block, the malicious script may load into your browser to download a suspicious file or anything that may affect your computer.

So, with JavaScript disabled, you protect yourself from hackers in a way.

However, other security threats are still lurking on different web pages. It could be something in the file you downloaded from a website or an email. It could also be a fake website where you entered your account credentials unknowingly.

Even if you have JavaScript blocked, you should still be careful, check if a link is safe, and use techniques like browser isolation to protect yourself from hackers.

How to Disable JavaScript in Chrome and Other Browsers

You can use some privacy-focused browser extensions to get more functionality and control. Again, this means your user experience will be affected.

Either way, you can explore content preferences (via Site Settings) in your Chrome browser, which can be found under the Privacy and Security settings of any Chrome-based browser.

You can refer to the official documentation of any other browser you tend to use.

Should JavaScript be disabled?

Although JavaScript can be exploited by hackers, you can absolutely stay safe from hackers even without disabling it.

You can choose to turn it off when you think a website is bloated with JavaScript giving you an unpleasant experience. But otherwise, you can still browse the web safely without turning it off, as long as you are careful at all times.

Comments are closed.