How to disable JavaScript in Firefox - gHacks Tech News

How to disable JavaScript in Firefox

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.





  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. 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.

    2. 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.

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

      thanks very good addon

    4. 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.

    5. 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.

    6. 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!

    7. 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. Martin Brinkmann said on August 7, 2013 at 4:07 pm
        Reply

        Thanks, that is a great tip.

      2. 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?

    8. 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.

    9. 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.

    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. 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…. (?)

    12. 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…)

    13. 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

    14. Rogerio M. Souza ([email protected]) said on November 2, 2013 at 11:52 pm
      Reply

      Thanks…

    15. 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

    16. 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.

    17. 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.

    18. 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.

    19. 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.

    Leave a Reply