我试图调试一个网站的功能,当用户禁用他们的JavaScript。我想知道如何从谷歌Chrome DevTools禁用JavaScript页面?


当前回答

点击“开发人员工具”角落的“”菜单,单击“设置” 单击底部的Advanced 点击内容设置 点击JavaScript 关掉

其他回答

这是窗户的最新设置

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

你也可以在默认禁用JavaScript的情况下运行Chrome:

-disable-javascript

你可以像这样运行Chrome来使用它:

C:\Documents and Settings\%username%\Local Settings\Application Data\Google\Chrome" -disable-javascript

官方文档:禁用JavaScript与Chrome DevTools

现在DevTools中内置了一个命令菜单,可以更容易地禁用JavaScript。这是在2016年4月左右。

DevTools开放。 按Command+Shift+P (Mac)或Control+Shift+P (Windows, Linux)打开命令菜单。确保你的光标聚焦在DevTools窗口上,而不是浏览器的视窗上。 输入Disable JavaScript(或者类似的版本…)这是一个模糊的搜索),然后按Enter。

当您希望重新启用JavaScript时,请使用Enable JavaScript命令。

Chrome浏览器(包括Opera)的完整和快速说明。

第一种方法

如果开发人员工具未打开,则按键盘上的F12键显示开发人员工具。在Opera浏览器中,你必须使用键盘上的Ctrl + Shift + i组合键来打开它。 要显示设置,只需按下键盘上的F1键。在进行此操作时,必须集中注意开发人员工具窗口。或者,如果你想用鼠标打开设置,那么你必须点击“开发人员工具”右上角的“设置”按钮,然后单击菜单中的“设置”。

然后你必须将设置窗口向下滚动到底部,然后你会看到用于禁用JavaScript的复选框,如下所示:

只需单击此复选框,并按下键盘esc键隐藏设置。如果你想启用它,那么你必须再次以同样的方式进行。

第二种方法

If Developer Tools aren't open then open it like in the first way is described. 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. 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.

如果这一切都不起作用

出于某种原因,它可能不起作用。在这种情况下,我在“隐身模式”中打开一个新的空网站,并在那里做所有这些。

最快的方法

在Chrome Web Store或Opera Addon站点上,你可以找到并安装每点击一次的扩展。只需搜索“Javascript切换器”:

Chrome浏览器 针对Opera浏览器

在OSX上,我必须点击三个垂直点,并取消设置部分的复选框。哪个也可以用f1打开