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?
This question is related to
javascript
google-chrome
google-chrome-devtools
Click the ?
menu in the corner of the Developer Tools, click Settings, then check Disable Javascript
under Debugger
.
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
good question, i try so many way, but it is curry and boring, until i find shortcut.
only two shortcut, but i think safari is more convenient for that.
To temporarily block JavaScript on a domain :
View site information
)JavaScript
, select Always block on this site
Update August 2020
Original answer
Paste it: chrome://settings/content
Go to "Javascript" section and disable it.
This is the latest setting for the windows
Settings > Advanced > Privacy and security > Site Settings > Javascript > Blocked then get switch on and off
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)
The first way
?
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:
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
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"
:
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
Using only the keyboard at least for Windows 10:
On Mac OS X:
The Chrome Quick JavaScript Switcher extension is a lot easier though :-)
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.
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.
The quickest way is problably this one:
This extension makes it faster : Quick Javascript Switcher
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?)
chrome://settings/content
Javascript/Manage Exceptions
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.
Source: Stackoverflow.com