Chrome开发工具 - 修改javascript并重新加载 [英] Chrome Dev Tools - Modify javascript and reload

查看:2027
本文介绍了Chrome开发工具 - 修改javascript并重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以修改页面的JavaScript然后重新加载页面而不重新加载修改后的JavaScript文件(从而失去修改)?

Is it possible to modify the JavaScript of a page and then reload the page without reloading the modified JavaScript file (and thus losing modifications)?

推荐答案

这是一个解决方法,但是你可以通过在javascript文件或块想要操作的块的开头添加一个断点来实现这一点。

This is a bit of a work around, but one way you can achieve this is by adding a breakpoint at the start of the javascript file or block you want to manipulate.

然后当您重新加载时,调试器将在该断点上暂停,您可以对源进行任何更改,保存文件,然后通过修改后的代码运行调试器。

Then when you reload, the debugger will pause on that breakpoint, and you can make any changes you want to the source, save the file and then run the debugger through the modified code.

但是正如大家所说,下次重新加载更改将会消失 - 至少它让你运行一些稍微修改过的JS客户端。

But as everyone has said, next reload the changes will be gone - at least it let's you run some slightly modified JS client side.

这篇关于Chrome开发工具 - 修改javascript并重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆