How to disable JavaScript in Firefox

Martin Brinkmann
Jul 30, 2013
Updated • Aug 7, 2013
Firefox
|
26

Up until Firefox 22, the current stable version of the web browser, JavaScript could be turned off in the content tab of the browser's options.  Here you only had to uncheck "enable JavaScript" to do so. A fast way to get there is to tap on the Alt-key, and select Tools > Options to do so.

With Firefox 23 comes a change that removes that option from the browser. It does not remove the ability to turn off JavaScript, only the menu option where it was listed in previously.

Whenever Mozilla makes a change to the browser, I'm trying to figure out why it was done. In regards to JavaScript, it appears to have been done so that inexperienced users do not turn the feature off by accident.

Firefox 22 Content menu

firefox 22 turn off javascript

Firefox 23 Content menu

firefox 23 content menu

As you can see if you compare the two screenshots, both the option to turn off JavaScript and to block images from loading automatically have been removed from the tab.

Turn off JavaScript in Firefox

You still have a variety of options at your disposal to turn off JavaScript in the browser. I'd like to provide you with a selection of options:

  1. Install the QuickJS extension for Firefox. It adds a single button to a toolbar that you can click on to turn JavaScript on or off. It also makes available the shortcut Ctrl-Q to do the same.
  2. You can turn off JavaScript in about:config. Type about:config in Firefox's address bar and hit the enter key. Confirm you will be careful, and search for javascript.enabled there. Double-click the preference to change its value.
  3. From Firefox 24 on, web developers have the option to turn off JavaScript temporarily. Open the Web Console via the menu or the Ctrl-Shift-K shortcut and click on the preferences icon there. Here you find disable JavaScript under advanced settings. This disables it only for the current session though.
  4. Install the powerful NoScript Security Suite to turn JavaScript off for all sites by default, but with options to turn it on temporarily or permanently for select websites.

Side-effects of the change

If you have turned off JavaScript in Firefox currently and upgrade to Firefox 23 or newer, you will notice that it will automatically be turned on again without you being notified about it.

You are probably wondering why that decision was made, as it changes a user's custom configuration of the browser without notification. It is again designed for inexperienced users who have turned off the feature by accident. The reasoning here is that inexperienced users would have a hard time figuring out how to turn JavaScript back on if they made the change by accident, while experienced users will certainly be able to figure out what happened.

The advanced options of the dialog seem to be gone. I'm not entirely sure if Mozilla has added them as preferences in about:config as well. If the organization did, they do not seem to appear with a javascript tag in there.

Update

The advanced options are not gone, they are also listed in the about:config dialog.

  • dom.disable_window_move_resize
  • dom.disable_window_flip/li>
  • dom.event.contextmenu.enabled

You find other options listed here as well. Just type in dom.disable or dom.event to take a look at those.

Closing Words

I do not think I have ever used the preference to turn off JavaScript which I can attribute 100% to the use of NoScript. I do know some users on the other hand who browse the web with JavaScript turned off by choice, and they may have a problem with Mozilla turning on JavaScript automatically in their browser when they update to Firefox 23.

Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. bogus said on July 17, 2014 at 5:20 am
    Reply

    Firefox continues to treat its new members like they are morons, isn’t that nice?

    1. Sichuan said on November 19, 2015 at 5:25 pm
      Reply

      Firefox is the world’s biggest nanny. Mozilla wants to be a dictator and cares absolutely nothing about the preferences of users. That’s why I dumped Firefox and went with Pale Moon, a much better browser, backed by a developer and his assistants who care very much about their users and respond accordingly.

  2. Haydrion said on February 18, 2014 at 1:49 am
    Reply

    I can’t understand why you want to disable javascript anyway, I found it a very good move from Firefox to remove that option. If you don’t want javascript than don’t go on the internet. 99% of all sites are build within Javascript which is also the most important language.

  3. Randall said on December 10, 2013 at 2:45 pm
    Reply

    If Mozilla is concerned with making FireFox idiot proof, they could have left the javascript controls alone, and simply put in a master reset default button.

    I am seriously thinking about trying out Palemoon, which is optimized firefox for windows.

    1. Sichuan said on November 19, 2015 at 5:26 pm
      Reply

      Pale Moon is a much better browser than Firefox, backed by a developer and his assistants who care very much about user preferences.

  4. notzed said on December 9, 2013 at 9:02 pm
    Reply

    Protecting ‘inexperienced users’ from making mistakes is just an excuse, not a reason. Unless we’re supposed to believe the ludicrous suggestion that users today are thicker and less tech savvy than they 15 years ago. When it’s pretty clear that tech literacy has never been higher.

    One can pretty reasonably surmise that this and the automatic updates are about ensuring the firefox ‘platform’ is a consistent target for app developers and advertisers (i.e. where firefox is trying to make more money and where it currently gets most of it’s money) and taking the control out of users hands which might mess with that ‘experience’. The few who will persevere enough to find out how to retain the functionality are inconsequential to the numbers game.

    It was about the time this was disabled that we heard of javascript-requiring techniques to implement cookie-less tracking for example, And even if they were a coincidence it’s still enough reason to want to retain the function on it’s own.

    Although another likely possibility is it’s just another casualty of the dumb-down-the-gui effort driven by wanna-be jobs-obsessed gui designers who keep messing up desktop software. Again nothing to do with dumb users, just egos.

  5. Alex said on November 20, 2013 at 5:50 pm
    Reply

    In firefox 24.1.1 you have the option “javascript.enabled” true | false in about:config

  6. Rogerio M. Souza (souzarm@gmail.com) said on November 2, 2013 at 11:52 pm
    Reply

    Thanks…

  7. Kemenag Kabupaten Karimun said on October 9, 2013 at 4:53 pm
    Reply

    ^_^ hehehe, thanks so much guy, Its work for Ctrl+shift+K, never mind for one session…
    my firefox is v.24. i need this information,,no information in my language. one again,,thanks so much…muaachhh

  8. Le Chroniqueur said on October 2, 2013 at 10:25 am
    Reply

    Thanks a lot for the discovery of the three advanced options! It saved my life (well, maybe i’m a bit overreacting, but well, I hated so much not being able anymore to tune these prefs…)

  9. Kurt said on August 27, 2013 at 3:37 pm
    Reply

    I find it very annoying if the context menu gets blocked by ignorant web designers (like on http://www.airport-grenchen.ch). It is also annoying if user settings get changed trough simple updates. Mozilla should make a “Firekitten” browser for beginners, but leave the expert settings alone! Maybe I should look at Chrome, too…. (?)

  10. Aram said on August 21, 2013 at 4:24 pm
    Reply

    “SettingSanity by RealityRipple”
    “Re-adds the options to disable Images, JavaScript, and the Tab Bar (in version 0.2) in the Options window.”

    Also restores the JavaScript “Advanced” button!

    https://addons.mozilla.org/en-us/firefox/addon/settingsanity/

    GREAT !!

    1. JS said on May 11, 2014 at 8:02 pm
      Reply

      YES! Thank you Aram for pointing out that add-on. Brings back settings that I don’t use daily, but when I want them, I don’t want to have to search to remember which setting in about:config actually does what I want. There are some annoying websites that disable the right-click menu for “security” reasons to “prevent people from downloading images locally”… which don’t quite realize that “printscreen” key still works for just about everyone, and that the images are already downloaded locally somewhere in order to be displayed.

      Settingsanity… it’s even slightly easier to remember than dom.argh.flarble.foo.whatever

  11. Chuck said on August 18, 2013 at 6:00 pm
    Reply

    Removing the ability to easily turn off JavaScript was a terrible thing to do to users. Many sites are bloated with JavaScript. To the point that they crash my browser. There are also security holes in many sites that use bad JavaScript. Netscape seems to have joined forces with spammers and hackers to try to force users to use JavaScript when they do not want to use it.

  12. Randall said on August 9, 2013 at 11:45 am
    Reply

    It’s very annoying, that firefox remove the javascript option, and image options in contents.

    I occasionally find it useful to temporary turn off javascript.

    I think I was also blocking urls in images.

    I am very seriously considering going back to firefox 22.

  13. Felipe said on August 7, 2013 at 3:55 pm
    Reply

    These are Advanced JavaScript ‘about:config’ just hidden preferences :

    Can JavaScript … Move or resize popup windows ? —> dom.disable_window_move_resize

    Can JavaScript … Raise or lower windows ? —> dom.disable_window_flip

    Can JavaScript … Disable or replace context menus ? —> dom.event.contextmenu.enabled

    In my case, when upgrading from FF22 to FF23 all these prefs have been set to default values.

    Regards.

    1. Patters said on August 8, 2013 at 5:52 pm
      Reply

      I find that dom.event.contextmenu.enabled does not have exactly the same effect as the removed “Can JavaScript … Disable or replace context menus ?” option.

      Does anyone know what is the correct setting to achieve the same effect?

      Previously, with JavaScript forbidden from disabling or replacing context menus, websites could still detect a right click event and display a custom menu, but it would be obscured by the default context menu. This way, if I wanted to use the website’s own menu, I simply had to press Esc to dismiss the default menu and then select an item from the website’s menu. Now, the choice appears to be either to have the default menu or the website’s menu, but not both, which is extremely inconvenient.

      Surely there must be another setting which restores the original behaviour?

    2. Martin Brinkmann said on August 7, 2013 at 4:07 pm
      Reply

      Thanks, that is a great tip.

  14. mofos said on August 6, 2013 at 7:27 pm
    Reply

    wtf those mofos removed that option where I could disable javascript overriding context menus and that stuff under the Advanced button
    i can’t believe it, switching to google chrome! the mofosss!

  15. Felipe said on August 1, 2013 at 3:58 am
    Reply

    Hi there,

    I am running Firefox 22.0 on Kubuntu Linux 13.04 and … having a look at my ‘about:config’ I have found this :

    pref.advanced.javascript.disable_button.advanced set by the user logical true

    I wonder if setting this pref to false before upgrading to Firefox 23 would provide me the availability of the advanced button … which for me is specialy interesting to maintain due to my configuration ( Javascript On … but all three advanced options Off ).

    Regards.

  16. IowaMan said on July 30, 2013 at 2:46 pm
    Reply

    “Toolbar Buttons 1.0” is a very handy collection of shortcut buttons for all kinds of things including javascript. An indispensable extension.

  17. hessam said on July 30, 2013 at 1:10 pm
    Reply

    thanks very good addon

  18. B. Moore said on July 30, 2013 at 12:47 pm
    Reply

    Has anyone every have Javascipt be turned off in firefox completely on its own.

    It has happened to me multiple times when I start firefox or while using firefox some how javascript gets turned off with out me doing anything.

    Has this happened to anyone? anyone know why this happens to me?

    1. Martin Brinkmann said on July 30, 2013 at 4:15 pm
      Reply

      This has never happened to me before.

  19. Transcontinental said on July 30, 2013 at 6:14 am
    Reply

    QuickJS is a handy ad-hoc add-on indeed, though I’ve never had to use it (that is to disable javascript) otherwise than to check if an item missed by Adblocker Plus was related to a script or not.
    For the fact of having the option removed from direct access (Firefox 23+), once again Mozilla is taking a bet on a new layout for beginners.
    As far as I’m concerned I won’t disagree excessively with Mozilla on this point, considering it remains accessible from about:config. What always bothers me is options removed in the core.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.