且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

页面刷新之前是否有断点?

更新时间:2023-12-02 23:48:40

尝试以下操作:


  1. 打开您的Chrome开发工具

  2. 导航至来源标签

  3. 在右侧面板上,展开事件监听器断点。

  4. 展开加载树

  5. 检查 beforeunload unload 选项

  1. Open your Chrome Dev Tools
  2. Navigate to the "Sources" tab
  3. On the right panel, expand "Event Listener Breakpoints"
  4. Expand the "Load" tree
  5. Check the beforeunload and unload options

看看是否有帮助;下面的屏幕截图。

See if that helps; screenshot below.

编辑:或者,如果没有不起作用,您可以使用Chrome浏览器在所有加载的脚本中搜索可能负责的代码。显然,有有很多方法可以使用JavaScript刷新页面,但是它们大多具有一些常见的字符串,例如 navigator,

Alternately, if that doesn't work, you can use Chrome to search all loaded scripts for the code that might be responsible. There's apparently a lot of ways to refresh the page with JavaScript but they mostly have a few common strings like "navigator", "location", "reload", "window".

最后,如果有指向您所在页面的链接,则可能是某些JS触发了对其的点击-不太可能,但是值得探索到目前为止是否还没有其他方法...

Finally, if there's a link to the same page you are on, it's possible some JS is triggering a click on it-- unlikely, but worth exploring if nothing else has worked thus far...

(请原谅我在移动设备上使用的格式...)

(Please excuse the formatting as I'm on mobile...)

注意:有时,由于我尚未完全理解的原因,该解决方案实际上无法导致调试器暂停;在这种情况下,我发现thorn̈对这个问题的回答可以解决问题我。

NOTE: It seems occasionally, for reasons I don't yet fully understand, this solution fails to actually cause the debugger to pause; in this situation, I found that thorn̈'s answer to this question did the trick for me.