在 Safari 中保留断点
如何让 Safari 的调试器在页面刷新过程中保留断点?我正在尝试调试onLoad执行的代码,因此在代码执行之前我没有时间设置断点,并且当我设置断点后刷新页面时,断点丢失。
(有问题的代码位于 Dojo 小部件中,因此它是通过 XHR 加载的,如果这很重要的话。)
How does one get Safari's debugger to persist a breakpoint across a page refresh? I'm trying to debug code that's executed onLoad, so I don't have time to set the breakpoint before the code is executed, and when I refresh the page after setting the breakpoint, the breakpoint is lost.
(The code in question is in a Dojo widget, so it's loaded via an XHR, if that matters.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个名为
debugger
的 javascript 语句可能对您有用。虽然此函数的记录很少,但它通常会触发浏览器的内置调试器。我在声明中真正找到的唯一注释是这个< /a>.虽然,我不确定为什么你的断点没有持续存在。我没有可用于测试的 Safari,但 Chrome(也基于 Webkit)似乎确实正确地保留了断点。
编辑
我设法找到调试器的文档 声明,但描述性不强:
There is a javascript statement which might be of use to you called
debugger
. While this function is poorly documented, it usually triggers your browser's built-in debugger. The only note I've really found on the statement is this.Although, I am not sure why your breakpoints are not persisting. I do not have Safari available to test, but Chrome (which is also based on Webkit) does seem to be persisting breakpoints correctly.
EDIT
I managed to find documentation for the
debugger
statement, but it is not very descriptive: