How to terminate script execution when debugging in Google Chrome?

后端 未结 11 1154
傲寒
傲寒 2020-12-07 08:16

When stepping through JavaScript code in Google Chrome debugger, how do I terminate script execution if I do not want to continue? The only way I found is closing the browse

11条回答
  •  执笔经年
    2020-12-07 09:12

    If you have a rogue loop, pause the code in Google Chrome debugger (the small "||" button while in Sources tab).

    Switch back to Chrome itself, open "Task Manager" (Shift+ESC), select your tab, click the "End Process" button.

    You will get the Aww Snap message and then you can reload (F5).

    As others have noted, reloading the page at the point of pausing is the same as restarting the rogue loop and can cause nasty lockups if the debugger also then locks (in some cases leading to restarting chrome or even the PC). The debugger needs a "Stop" button. Nb: The accepted answer is out of date in that some aspects of it are now apparently wrong. If you vote me down, pls explain :).

提交回复
热议问题