I know that I can trigger "Pause script execution" action in Google Chrome DevTools by having DevTools open with Sources tab active and press F8.
However, this seems to move focus out from the content area triggering additional events and I'm trying to debug some code that listens focus and blur events in addition to other events I'm trying to debug.
What I would really need is ability to trigger the "Pause script execution" feature without pressing F8. The closest I can do is executing setTimeout(function(){ debugger; }, 2000); in the JS console but that will stop all JS processing instantly after 2 second delay. The feature I'd like to use from DevTools is ability to delay stopping until some code actually runs so that the event queue already has the next events when scripting is stopped. (I'm basically trying to figure out what events are already in the queue in some specific situations and any extra focus/blur events will mess that work.)
Is there a way to trigger "Pause script execution" without pressing F8 or clicking the GUI button because both mess with the focus events?
data:text/html,<script>document.addEventListener("keydown", function(e) { console.log(e); });</script><div contenteditable=true style="border: solid pink 1rem; padding: 1rem;">abc, enable "focus emulation" and then type something in the pink area, press F8 (while Sources tab active in DevTools) and then continue typing. Text no longer goes to the content editable area (and no keydown events either) even though focus appears to be there.