[英]Force chrome to refresh a page while debugging with breakpoints
If I have a breakpoint in a loop or frequent interval I can't refresh chrome without forcing a reload with ctrl-r
. 如果我在循环或频繁的间隔中有一个断点,我不能刷新chrome而不强制使用
ctrl-r
重新加载。
Hitting F5
/clicking the refresh button will do a normal refresh, loading just the modified content, unless the debugger has paused on a breakpoint in which case the debugger continues. 按
F5
/单击刷新按钮将执行正常刷新,仅加载修改后的内容,除非调试器在断点处暂停,在这种情况下调试器将继续。 Holding/spamming F5
just cycles through breakpoints and I can't refresh the page after spotting a bug and making code changes. 保持/发送垃圾邮件
F5
只是循环通过断点,我发现错误并进行代码更改后无法刷新页面。 I'd prefer not to do a full reload ( ctrl-r
) because I have images and other content that get cached and don't need to be re-downloaded. 我不想完全重新加载(
ctrl-r
)因为我有图像和其他内容被缓存而不需要重新下载。
One solution is to close the debugger, refresh and then open the debugger. 一种解决方案是关闭调试器,刷新然后打开调试器。 However, the JS then gets a chance to run before the debugger is back up.
但是,JS在调试器备份之前有机会运行。 I then have to refresh again so the JS runs from the beginning.
然后我必须再次刷新,以便JS从头开始运行。
Has anyone found a workaround? 有没有人找到解决方法?
It could be just me, but I frequently want to make changes to my code and debug it at the same time. 它可能只是我,但我经常想要更改我的代码并同时调试它。
Refresh: F5 刷新: F5
No, actually refresh: 不,实际刷新:
+ F5 ?
+ F5 ?
What works for me is to CMD + R (I'm on OS X) then F8 . 对我有用的是CMD + R (我在OS X上),然后是F8 。
It seems that reload is done only after you pass the current breakpoint. 似乎只有在传递当前断点后才会重新加载。
Right click on refresh button. 右键单击刷新按钮。 Then choose one of the reload options.
然后选择其中一个重新加载选项。
Have you tried running the following from the Console? 您是否尝试从控制台运行以下命令?
window.location.reload() window.location.reload()
What would reload only the content of the page, and not web inspector. 什么会重新加载页面的内容,而不是web检查器。
A simple solution could be to use the "Deactivate breakpoints" button. 一个简单的解决方案是使用“Deactivate breakpoints”按钮。 This will let the flow happen without stopping.
这将使流程不停地发生。
Then you can use the F5 to just reload the changes. 然后,您可以使用F5重新加载更改。
UPDATE UPDATE
Given you want to have breakpoints enabled as soon as you load the page, you can do following. 如果您希望在加载页面后立即启用断点,则可以执行以下操作。
In Chrome, Debug Toolbar, go to settings icon at the bottom left corner (or on the toolbar header) and choose disable cache. 在Chrome的“调试工具栏”中,转到左下角(或工具栏标题)上的设置图标,然后选择“禁用缓存”。 then try reloading.
然后尝试重新加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.