Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome 80: Pause script execution (F8) does not work when DevTools is not focused

since Chrome 80 I cannot pause the script execution when the focus is on the website I'm developing. This is extremely inconvenient e.g. when debugging hover effects.

Does anyone else experience this issue or has more information about it? Maybe a feature flag deep inside the browser settings?

Update

This was fixed in Chrome 83.

like image 982
thoro Avatar asked Feb 10 '20 10:02

thoro


People also ask

How do I pause a script execution in Chrome?

Pausing script execution is F8 (when looking at the Sources tab, as of Chrome 45) or Ctrl + / .

How can I stop Chrome from going into debug mode?

Go to the "Sources" tab. At the top right hand side, toggle the button that looks like the pause symbol surrounded by a hexagon (button on the far right) until the color of the circle turns black to turn it off. If the pause symbol isn't blue it may be that you've accidentally marked a line for debugging inspection.

How do I enable F12 Developer Tools in Chrome?

In Chrome, pressing the F12 key or Ctrl + Shift + I (or Command + option + I on a Mac) also brings up the interactive developer tools.


2 Answers

Until it is fixed, you can use the following in your app:

document.addEventListener('keydown', function (e) {
    if (e.keyCode == 119) { // F8
        debugger;
    }
}, {
    capture: true
});
like image 57
Roland Soós Avatar answered Oct 27 '22 20:10

Roland Soós


It's a bug in Chrome, I found the bugreport here:

https://bugs.chromium.org/p/chromium/issues/detail?id=1049910&q=f8&can=2

like image 4
thoro Avatar answered Oct 27 '22 18:10

thoro