简体   繁体   English

JS:Chrome开发工具中对JS文件的更改未反映

[英]JS: Changes to JS files in chrome dev tools are not reflecting

I am trying to edit a JS file in chrome dev tools and half the time it works but the other half of the time the server JS file is cached and it used that, despite my changes. 我试图在chrome开发工具中编辑JS文件,但有一半的时间可以工作,但是有一半的时间是服务器JS文件被缓存并使用了,尽管我进行了更改。

I am trying to test a production feature only so I need to test it this way -- is there a way to ensure I can edit the chrome JS files so that it reflects each time in browser when testing? 我仅尝试测试生产功能,因此需要以这种方式进行测试-有没有一种方法可以确保我可以编辑chrome JS文件,以使其在测试时每次都在浏览器中反映出来?

Chrome has a feature called Local Overrides , which is basically this. Chrome具有一项称为Local Overrides的功能,基本上就是这样。 It allows you to use a file location from your computer to load the webpage assets from, which you can modify, and the modifications will persist. 它允许您使用计算机中的文件位置来加载网页资产,可以对其进行修改,并且修改将继续进行。 Once you turn off the feature, it will revert to what is being served from the pages host (or cache), but you can re-enable and continue on. 关闭此功能后,它将恢复为页面主机(或缓存)所提供的服务,但是您可以重新启用并继续。

As a word of note, this is only available (as far as I know) in Chrome V65+ 值得一提的是,据我所知,此功能仅在Chrome V65 +中可用

Chrome 65 Release Video Chrome 65发布视频

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM