chrome禁用缓存_如何在Google Chrome中禁用(和启用)JavaScript

chrome禁用缓存

chrome禁用缓存

Google Chrome Logo

You may be wondering how a site looks with or without JavaScript. On Chrome, JavaScript is enabled by default, but you can disable it fairly quickly to see what a site looks like without all the moving parts. Here’s how.

您可能想知道带有或不带有JavaScript的网站的外观。 在Chrome上,默认情况下会启用JavaScript,但是您可以相当快地将其禁用,以查看没有任何活动部分的网站外观。 这是如何做。

为什么要启用或禁用JavaScript? (Why Should I Enable or Disable JavaScript?)

Modern websites have a lot of moving parts. Almost every online magazine and blog runs ads to support the site’s staff. With JavaScript enabled, you’re able to see these ads (and support the site as a result).

现代网站有很多活动部分。 几乎每个在线杂志和博客都投放广告来支持网站的工作人员。 启用JavaScript后,您就可以看到这些广告(并因此支持该网站)。

Most websites require JavaScript to be enabled for all its bells and whistles to work properly, too. For example, if you disable JavaScript in your browser, you can say goodbye to automatic timeline updates on Twitter. With JavaScript enabled, you’re able to take advantage of most features that make websites around the web great.

大多数网站都要求启用JavaScript才能使其所有功能正常运行。 例如,如果禁用浏览器中JavaScript,则可以告别Twitter上的自动时间轴更新。 启用JavaScript后,您就可以利用大多数功能,使网上的网站更加出色。

There may come a time, though, when you want to block ads on certain sites, or see how a website looks without JavaScript enabled. In Google Chrome, you can disable JavaScript completely, or on a per-site basis. If you have a change of heart later on, it’s easy to re-enable JavaScript.

不过,有时候您可能想在某些网站上屏蔽广告,或者查看未启用JavaScript的网站的外观。 在Google Chrome浏览器中,您可以完全禁用JavaScript,也可以基于每个站点禁用JavaScript。 如果以后您改变主意,可以很容易地重新启用JavaScript。

Here’s how it’s done.

这是完成的过程。

在Chrome的设置中禁用和启用JavaScript (Disable and Enable JavaScript in Chrome’s Settings)

The easiest way to access the JavaScript options menu on Google Chrome is by entering this URL in the address bar in Chrome:

在Google Chrome上访问JavaScript选项菜单的最简单方法是在Chrome的地址栏中输入以下网址:

Chrome://settings/content/javascript

Chrome://settings/content/javascript

If you want to get there the old-fashioned way, you’ll need to select the three vertical dots icon in the top-right corner of the browser window.

如果您想以老式的方式到达那里,则需要选择浏览器窗口右上角的三个垂直点图标。

Three vertical dots icon in Chrome

Towards the bottom of the drop-down menu that appears, select “Settings”.

在出现的下拉菜单底部,选择“设置”。

Settings option in dropdown menu

Find the “Privacy and Security” section and select “Site Settings”.

找到“隐私和安全性”部分,然后选择“网站设置”。

Site settings option

Finally, click “JavaScript” in the “Permissions” group.

最后,在“权限”组中单击“ JavaScript”。

Javascript option

By default, JavaScript is enabled. To disable JavaScript, move the slider to the left (by clicking it) next to the “Allowed” option. Enable JavaScript again by moving the slider back to the right.

默认情况下,启用JavaScript。 要禁用JavaScript,请将滑块移至“允许”选项旁边的左侧(通过单击)。 向右移动滑块,再次启用JavaScript。

Allow or disable javascript slider

允许或阻止特定站点上JavaScript (Allow or Block JavaScript on Specific Sites)

As previously mentioned, you can also enable or disable JavaScript for specific sites. To do this, navigate back to the JavaScript settings menu in Chrome by going to this URL:

如前所述,您还可以为特定站点启用或禁用JavaScript。 为此,请转到以下URL,导航回Chrome中JavaScript设置菜单:

Chrome://settings/content/javascript

Chrome://settings/content/javascript

Once there, you’ll see a “Block” and “Allow” section. Select “Add” next to Block (1) or Allow (2), depending on if you want to disable or enable JavaScript on a site, respectively.

到达那里后,您将看到“阻止”和“允许”部分。 根据要在站点上禁用还是启用JavaScript,分别选择块(1)或允许(2)旁边的“添加”。

Allow and block javascript on specific sites

The “Add A Site” window will now appear. Enter the site URL, then select the “Add” button.

现在将出现“添加站点”窗口。 输入站点URL,然后选择“添加”按钮。

Enter web url to allow or block javascript

The site will now appear in your “Block” or “Allow” list, meaning that next time you visit that site, JavaScript will be disabled or enabled, respectively.

该站点现在将出现在“阻止”或“允许”列表中,这意味着下次访问该站点时,将分别禁用或启用JavaScript。

example showing block list

使用Chrome DevTools禁用JavaScript进行测试 (Disable JavaScript with Chrome DevTools for Testing)

If JavaScript is enabled on Chrome and you’re wanting to see what a specific site looks like without going through the settings menu, you can disable JavaScript from Chrome’s DevTools while you’re on that site. This should only be used for testing purposes, though, as JavaScript will be re-enabled on the site once you close DevTools.

如果在Chrome上启用了JavaScript,并且您想查看特定网站的外观而无需通过设置菜单,则可以在该网站上通过Chrome的DevTools禁用JavaScript。 但是,这仅应用于测试目的,因为一旦关闭DevTools,JavaScript将在站点上重新启用。

While you’re on the site, open DevTools. You can do this by right-clicking anywhere on the site and selecting “Inspect”.

在网站上时,打开DevTools。 您可以通过右键单击站点上的任意位置并选择“检查”来执行此操作。

Inspect option

Alternatively, you can use the Control + Shift + 3 (Windows) or Command + Option + 3 (Mac) keyboard shortcut.

或者,您可以使用Control + Shift + 3(Windows)或Command + Option + 3(Mac)键盘快捷键。

Once you’re in DevTools, open the Command menu by pressing Control + Shift + P (Windows) or Command + Shift + P (Mac).

进入DevTools后,请按Control + Shift + P(Windows)或Command + Shift + P(Mac)打开“命令”菜单。

command menu

In the search bar of the Command menu, type “JavaScript”, select “Disable JavaScript”, and then press the Enter key to run the disable JavaScript command.

在“命令”菜单的搜索栏中,键入“ JavaScript”,选择“禁用JavaScript”,然后按Enter键以运行禁用JavaScript命令。

disable javascript command

JavaScript is now disabled for this site. You can hover over the yellow warning icon next to the “Sources” tab to verify JavaScript is disabled.

现在已禁用此站点JavaScript。 您可以将鼠标悬停在“来源”标签旁边的黄色警告图标上,以验证JavaScript是否已禁用。

javascript is disabled warning

翻译自: https://www.howtogeek.com/663569/how-to-disable-and-enable-javascript-on-google-chrome/

chrome禁用缓存

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值