Skip to main content

Jun 15, 2020 - 4 minute read - Technical Testing Tips

How to Turn off JavaScript

Turning off JavaScript is becoming more important than ever because so many sites are JavaScript heavy. Many sites use JavaScript as their protection mechanism to paywall content and prevent spam. Testing these without JavaScript enabled is important.

Initially posted, 2013-09-11 to cover Firefox. Updated 2020-06-15, to cover Chrome, updated plugins and more approaches.

Short Version:

Browsers Change all the time

Whoa, I turn my back for a couple of months and Mozilla remove the option to switch off JavaScript in Firefox.

We spent a good 5 or 10 minutes thinking we were crazy. “I’m sure the option used to live here…”

As ever, a quick web search came to the rescue. But some of the resources are out of date, so I’ll describe the approaches I use, so if any plugins go out of date, you can still switch off JavaScript.

Why did Mozilla do this? Because of “Checkboxes that kill your product”.

Unfortunately, as a tester I still experience moments where I need to kill the product browser functionality, so How can I do that?

And this helps me in my normal life for making the web more friendly and avoiding sites with multiple pop ups, divs, and dialogs.

Normal users, do switch off JavaScript. Make sure you test your site without JavaScript for critical functionality.

Chrome

I know of three ways to switch off JavaScript in Chrome.

Quick JavaScript Switcher Plugin

I have used the Quick JavaScript Switcher plugin and find it to be quite reliable.

Chrome remembers your JavaScript settings for different sites, so this is quite useful for when you return to the same sites, to keep JavaScript off.

Chrome Dev Tools

  • Chrome - Inspect to show dev tools, Run command, Disable JavaScript

The JavaScript Debugger can be used to switch on and off JavaScript.

Fortunately you don’t need to be able to use the debugger.

Pop up the Dev Tools, either by right clicking on the page and choosing ‘inspect’, or use the hamburger menu on the tool bar to select ‘more tools > Developer Tools’.

Then use the developer tool hamburger menu to select Run Command and disable javascript or enable javascript.

Chrome Settings

We can also switch off JavaScript using the settings in Chrome.

  • visit chrome://settings
  • Search for “JavaScript”
    • or type the following into your ulr chrome://settings/content/javascript?search=javascript
  • then enable or disable JavaScript
    • also on a site by site basis

Firefox

“about:config” javascript.enabled

Firefox has the built in “about:config” which you can type into the URL entry field. Then search for “javascript.enabled” and click on the “javascript.enabled” to switch JavaScript on and off.

Add-ons

The old extensions I used are no longer available so I have installed JavaScript Toggler extension.

End Notes

As an opinion, I find it a bit odd that since Browsers make ever more developer functionality available at the click of a mouse to every user: allowing them to edit the DOM, or execute arbitrary JavaScript, or amend and delete cookies, etc. etc. I don’t think I’d make switching JavaScript off a hard thing to do - this is one of the few things I actually do, as a user, to make a misbehaving website behave (the way I want it to).

And if you raise a bug related to JavaScript being switched off, and are told that ‘no user would ever do that’… I frequently help ‘normal users’ do this. So you can always point people here.

Online Technical Web Testing Training

If you want to learn more about Chrome Developer tools then I have an online course on Technical Web Testing that might help.


You will need a Github account to comment. Or you can contact me with your comment.

I reserve the right to delete spam comments e.g. if your comment adds no value and its purpose is simply to create a backlink to another site offering training, or courses, etc.