简体   繁体   English

有没有办法在Chrome调试器中暂停卡住的脚本?

[英]Is there a way to pause a stuck script in the chrome debugger?

Occasionally, while programming JavaScript, I will make a bone headed mistake and can get the page stuck in an infinite loop while it is loading. 有时,在编写JavaScript时,我会犯一个严重的错误,并可能导致页面在加载时陷入无限循环。 I typically will use Chrome for this and, when I get in this state, I cannot do anything with the javascript developer tools. 我通常会为此使用Chrome,当我进入这种状态时,我将无法使用javascript开发人员工具执行任何操作。 What I would really like is a break command similar to what can be done within Visual Studio's debugger that will pause the interpreter and display the current line being executed along with the call stack. 我真正想要的是一个break命令,类似于Visual Studio调试器中可以执行的操作,该命令将暂停解释器并显示当前正在执行的行以及调用堆栈。 Is there any such functionality available. 是否有任何可用的此类功能。

As an alternative to this, I would be handy to set break points in the code. 作为替代方案,我将很方便在代码中设置断点。 Regardless, I need some way to interrupt the process so that I can determine the cause of the lock-up. 无论如何,我都需要某种方法来中断该过程,以便确定锁定的原因。

you can add a debugger; 您可以添加debugger; statement somewhere in your code where you want to break execution and continue stepping from there on with the Step Next, Step Over, etc 语句在代码中您想中断执行并继续执行下一步,继续执行等的地方

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

相关问题 有没有办法让google chrome脚本调试器在异常时中断? - Is there a way to get the google chrome script debugger to break on exception? 这个Chrome调试器VM脚本是什么? - What is this Chrome debugger VM script? chrome:如何中止在`debugger`语句中停止的脚本? - chrome: How to abort a script that is stopped at `debugger` statement? 有没有办法在 Chrome 调试器中移动程序计数器? - Is there a way to move the program counter in the Chrome debugger? 是否可以在 JavaScript 代码执行的每个 console.log 语句上暂停 chrome 调试器? - Is it possible to pause the chrome debugger on every console.log statement executed by the JavaScript code? 使用 TamperMonkey 脚本暂停本机 Chrome HTML5 播放器上的视频 - Pause video on native Chrome HTML5 Player with TamperMonkey Script 在响应页面脚本之前暂停[Chrome DevTools] - Pause before response page script is called [Chrome DevTools] 有没有办法告诉网络浏览器继续“卡住”脚本? - Is there a way to tell webbrowser to continiue script that is “stuck”? Chrome webtools调试器可以自行恢复脚本执行 - Chrome webtools debugger resumes script execution on its own 在Chrome的脚本调试器中隐藏范围变量工具提示 - Hiding scope variable tooltip in Chrome's script debugger
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM