462

I am trying to debug the features of a website when users disable their JavaScript. I was wondering how do you disable JavaScript for a page from the Google Chrome DevTools?

Bharata
  • 11,779
  • 6
  • 27
  • 42
Jopela
  • 4,955
  • 2
  • 15
  • 19
  • 2
    The command menu, which has been around since about April 2016, is probably faster than the older workflows that relied on going into DevTools settings: http://stackoverflow.com/a/40727332/1669860 – Kayce Basques Nov 21 '16 at 18:51

20 Answers20

588

enter image description here

Click the gear icon in the corner of the Developer Tools, click Settings, then check Disable Javascript under Debugger.

Dana Woodman
  • 3,003
  • 28
  • 28
SLaks
  • 800,742
  • 167
  • 1,811
  • 1,896
  • It is not working for me too. @Matt did you find a solution? I am trying to avoid a page from auto reloading using javascript and chrome developer tools disable JavaScript is not working. – Krishna Apr 25 '13 at 16:27
  • @Krishna: It's probably auto-reloading without Javascript. – SLaks Apr 25 '13 at 17:13
  • Yes. Looked at the source and was meaning to update it here a few hours back, but got held up. It is using meta refresh. – Krishna Apr 25 '13 at 20:33
  • 6
    If still not working, consider Ctrl+Shift+n, Open new Chrome window in incognito mode. – PaintyJoy Sep 22 '14 at 02:14
  • 5
    @PaintyJoy, thanks for that tip. For some reason my "Disable Javascript" is being buggy when I refresh... "Incognito Mode" -> F12 > Settings > "Disable Javascript" -> Refresh works! Would love to know WHY it's not working in regular mode. I haven't found any tickets for this issue. Seems to only happen to certain users. – Phil Tune Oct 29 '14 at 19:16
  • 2
    @MattParkins Chrome Developer Tool seem to break every now and then ("complex" code I guess ^^). So use Alex's answer isntead http://stackoverflow.com/a/13405449/759452 – Adrien Be Dec 05 '14 at 13:48
  • I know this is an older post, but it was the only thing that helped me with a google search of `google chrome 45.0.2454.85 incognito disable javascript` .. and I had to do it through DDG at that .. just wanted to note that as of a fresh install of Chrome 45.0.2454.85 the 'gear icon' does not show anywhere on the screen (in regular or incognito mode) and I had to hit `F12` to get the to icon .. FYI to others that might have the same issue – txtechhelp Sep 11 '15 at 23:02
  • @txtechhelp: The question is specifically asking how to disable Javascript _from the dev tools_. Clarified. – SLaks Sep 13 '15 at 01:21
  • 6
    Can you please add a screenshot that shows the location of the *"gear"* icon in the lower-right corner of the Developer Tools? For example, [here is a screenshot of the Developer Tools that shows there is no *"gear"* icon](http://i.imgur.com/OjQHSaj.png). – Ian Boyd Dec 29 '15 at 15:39
  • There is no gear icon anymore, they removed it at some point. – Shadow The Vaccinated Wizard Mar 14 '16 at 12:32
  • @ShadowWizard: Click the `...` menu in the corner, then Settings. – SLaks Mar 14 '16 at 13:54
  • Yeah, they moved the cheese around. Found it in a newer answer. :) – Shadow The Vaccinated Wizard Mar 14 '16 at 14:25
  • 7
    You will now find the "Disable JavaScript" option on the right side in de Preferences menu. Headline is: "Debugger" – Tomkay Oct 19 '16 at 11:37
  • It doesn't always work. I can't stop the javascript of Chrome Extensions even if I disable it both on the page and on the extension inspect view. – Nathan B Jun 06 '18 at 16:10
  • Oops, accidentally downvoted... Idea for the answer edit (so I can revert vote) is to highlight `Settings` as other menu items. Did not catch it at the first glance. – BoShurik Nov 08 '19 at 13:03
204

Update August 2020

  1. Developer Tools (F12)
  2. Click the Gear icon

Settings

  1. Should open the Preference tab
  2. Disable Javascript option is on the far right

Disable JS option

Original answer

  1. Developer Tools (F12)
  2. Three vertical dots in upper right
  3. Settings
  4. Under the "Preferences" tab on the left

Preferences section

  1. There will be a "Debugger" section with the option (probably on far right)

Disable check box

Scott Decker
  • 3,659
  • 5
  • 21
  • 36
95

Official documentation: Disable JavaScript With Chrome DevTools

There's now a command menu built into DevTools that makes it easier to disable JavaScript. This has been around as of April 2016 or so.

  1. Open DevTools.
  2. Press Command+Shift+P (Mac) or Control+Shift+P (Windows, Linux) to open the Command Menu. Make sure that your cursor's focus is on the DevTools window, not your browser viewport.
  3. Type Disable JavaScript (or some version of that... it's a fuzzy search) and then press Enter.

Use the Enable JavaScript command when you want to turn it back on.

disabling js via command menu

Kayce Basques
  • 17,419
  • 7
  • 71
  • 96
38

chrome://settings/content Javascript/Manage Exceptions

Babadzhanov
  • 175
  • 2
  • 14
Ales
  • 898
  • 1
  • 6
  • 13
21

This extension makes it faster (I am the author) : Quick Javascript Switcher

It is open source: https://github.com/maximelebreton/quick-javascript-switcher

mlb
  • 633
  • 7
  • 11
13

You can also run Chrome with JavaScript disabled by default by using the flag:

-disable-javascript

You would use this for example by running Chrome like this:

C:\Documents and Settings\%username%\Local Settings\Application Data\Google\Chrome" -disable-javascript
jaredwilli
  • 10,288
  • 5
  • 39
  • 40
9

The quickest way is problably this one:

  • F12 to open the dev console
  • ctrl + shift + p to open the command tool (windows)
  • Type 'disable javascript' and hit enter
remborg
  • 415
  • 3
  • 8
7

On OSX, I had to click the triple vertical dots, and uncheck a box in the settings section. Which can also be opened with f1

DigitalDesignDj
  • 1,585
  • 14
  • 16
4

Using only the keyboard at least for Windows 10:

  • F12, shows Developer Tools
  • F1, shows Settings
  • tab, moves to the "Disable Javascript" check box
  • space, toggles the option
  • esc, hides Settings
bishop
  • 32,403
  • 9
  • 89
  • 122
4

To temporarily block JavaScript on a domain :

  1. Click on the Button left to the address on the address bar (which says View site information)
  2. In the drop-down next to JavaScript, select Always block on this site
  3. Reload Page
3

On Mac OS X:

  • Preferences
  • Show advanced settings
  • Press the "content settings" button
  • Scroll to the "JavaScript" section
  • Check the checkbox in front of "Do not allow any site to run JavaScript"

The Chrome Quick JavaScript Switcher extension is a lot easier though :-)

Niels Bom
  • 7,436
  • 8
  • 41
  • 54
3
  • Go to options (Windows: three vertical dots in the top right) -> Settings, or hit F1.
  • In the General section you find "disable JavaScript"

The gear icon is no longer part of developer tools. Since Chome 30.0 it is not even possible to bring it back (In Google Chrome Developer Tools, the toolbar icons disappeared. What gives?)

Community
  • 1
  • 1
F Pereira
  • 687
  • 7
  • 8
3

The fast way:

1) just click on CTRL + SHIFT + P

2) fill the field by the 3 letters dis and will appear this box and select the item Disable Javascript

disable javascript .

that's all folks!

marcdahan
  • 1,818
  • 19
  • 18
3
  • Click the ⋮ menu in the corner of the Developer Tools, click Settings
  • Click on Advanced at the bottom
  • Click on Content Settings
  • Click on JavaScript
  • Switch off
Sarang
  • 734
  • 2
  • 8
  • 23
2

Full and fast instructions for Chrome browsers (Opera incl.)

The first way

  1. If Developer Tools aren't open then press F12 key on keyboard to show the Developer Tools. In Opera browser you have to use key combination Ctrl + Shift + i on keyboard to open it.
  2. To show the settings just press F1 key on keyboard. The Developer Tools window must be focused when you are doing it. Or if you want to open the settings with the mouse then you have to click on button in the top right corner of the Developer Tools, then click Settings in the menu.

Then you have to scroll down the settings window to bottom and then you will see the checkbox for disabling JavaScript like follows:

disable JavaScript in chrome developer tools

Just click on this checkbox and push esc key on keyboard for hide the settings. If you want to enable it then you have to do the same way again.

The second way

  1. If Developer Tools aren't open then open it like in the first way is described.
  2. Press the key combination Ctrl + Shift + P (for Windows or Linux) or Cmd (⌘) + Shift + P (for Mac) to open the Command Menu. Be sure that the focus is on the DevTools window.
  3. Type there "Disable JavaScript" and then press Enter or click it with the mouse. If you want to turn back the enanled JS then open the Command Menu again and type there "Enable JavaScript" and then press Enter or click it with the mouse. You could also write just only "JavaScript" or "Java" there and then choose it with the mouse.

disable JavaScript in chrome developer tools

If all this does not work

For some reason it is possible that it does not work. I this case open a new empty site in "Incognito Mode" and do all this there.

The quickest way

In Chrome Web Store or on Opera Addon site you can find and install extensions which do it per one click. Just search "Javascript Switcher":

Bharata
  • 11,779
  • 6
  • 27
  • 42
2

Press F8 for temporarily freezing / unfreezing JS (with DevTools open).

This is very useful for debugging UI issues on elements that may lose focus if you click or press anything outside of that element. (Chrome 71.0.3578.98, Ubuntu 18.10)

Dan D.
  • 745
  • 6
  • 14
1

Paste it: chrome://settings/content

Go to "Javascript" section and disable it.

aletede91
  • 986
  • 1
  • 8
  • 26
0
Chrome://chrome/settings/Privacy/Content settings/JavaScript

and there you can PASTE your website's URL in Manage exceptions.. and change the JavaScript priority from ALLOW to BLOCK.

Chirag Dave
  • 169
  • 1
  • 5
0

This is the latest setting for the windows

Settings > Advanced > Privacy and security > Site Settings > Javascript > Blocked then get switch on and off
Sheo Sagar
  • 609
  • 7
  • 9
0

good question, i try so many way, but it is curry and boring, until i find shortcut.

  1. alt + cmd + i, this open dev tools, unless you use pocket, that need set other shortcut.
  2. shift + cmd + p, then input: javascript

only two shortcut, but i think safari is more convenient for that.

defend orca
  • 175
  • 1
  • 11