Jopela
Jopela

Reputation: 5685

How to disable JavaScript in Chrome Developer Tools?

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?

Upvotes: 533

Views: 515939

Answers (22)

stevec
stevec

Reputation: 52208

I arrived here simply wanting to know how to disable javascript in chrome:

  1. Right click on the website
  2. Click "inspect"
  3. Hit keys: ctrl + shift + p
  4. Type: "Java"
  5. Click "disable JavaScript"
  6. Refresh page

It's from here

Upvotes: 2

SLaks
SLaks

Reputation: 887195

Click the gear icon in the corner of the Developer Tools, click Settings, then under Debugger, check Disable Javascript, as shown in the following video:

enter image description here

Upvotes: 699

PauAI
PauAI

Reputation: 403

There's a settings in chrome

open the menu from chrome, click settings > type in "javascript" in the search bar > click site settings > click javascript.

from here you can toggle javascript specifically to a site using their url. or just click the big button to allow/block it to all sites.

enter image description here

Upvotes: 0

mlb
mlb

Reputation: 681

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

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

Upvotes: 20

Scott Decker
Scott Decker

Reputation: 4297

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

Upvotes: 217

Ales
Ales

Reputation: 908

chrome://settings/content Javascript/Manage Exceptions

Upvotes: 39

defend orca
defend orca

Reputation: 743

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.

Upvotes: 0

Sheo Sagar
Sheo Sagar

Reputation: 917

This is the latest setting for the windows

Settings > Advanced > Privacy and security > Site Settings > Javascript > Blocked then get switch on and off

Upvotes: 0

Kayce Basques
Kayce Basques

Reputation: 25897

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

Upvotes: 112

Dan D.
Dan D.

Reputation: 875

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)

Upvotes: 2

Bharata
Bharata

Reputation: 14155

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":

Upvotes: 3

marcdahan
marcdahan

Reputation: 3042

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!

Upvotes: 4

Sarang
Sarang

Reputation: 784

  • 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

Upvotes: 3

remborg
remborg

Reputation: 548

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

Upvotes: 11

aletede91
aletede91

Reputation: 1166

Paste it: chrome://settings/content

Go to "Javascript" section and disable it.

Upvotes: 1

Anu Shibin Joseph Raj
Anu Shibin Joseph Raj

Reputation: 1047

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

Upvotes: 3

bishop
bishop

Reputation: 39354

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

Upvotes: 6

Chirag Dave
Chirag Dave

Reputation: 179

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.

Upvotes: 0

F Pereira
F Pereira

Reputation: 1367

  • 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?)

Upvotes: 3

DigitalDesignDj
DigitalDesignDj

Reputation: 1885

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

Upvotes: 7

Niels Bom
Niels Bom

Reputation: 9377

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 :-)

Upvotes: 3

jaredwilli
jaredwilli

Reputation: 12308

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

Upvotes: 12

Related Questions