How to stop scripts execution on the page?
Adding to Gideon Pyzer:
Shift-Ctrl-I
- wait for devTools to open,
then Shift-Ctrl-P
- if you don't wait: print dialog will open...
then -see Gideon Pyzer's answer-.
You can enable/disable JavaScript on the page at any point using the command menu in DevTools. You can access this menu by using Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux).
Start typing Disable JavaScript
and hit Enter to disable script execution.
In the following example, I ran an asynchronous timer to log an incremental count every 500ms. Upon disabling JavaScript, the execution was paused and nothing else logged to the console.
I later re-enabled JavaScript by typing 'Enable JavaScript` and hitting Enter. Upon doing this, the execution continued and the timer continued where it left off.
Note: Any synchronous code still running when you try to disable JavaScript won't be killed. It will finish and then further execution will be disabled.