18

I am using Chrome's Developer Console to study the code of a page, but then the page has a javascript that calls the debugger.

(function() {
debugger
})

And the page paused, then whenever I press the blue arrow to resume script execution another of such function is called, making it impossible to load the page. Is there a way to switch off the call to debugger in Chrome such that the page can be load without pausing? I turned off "paused on exception" but it doesn't stop the pausing.

albertma789
  • 353
  • 2
  • 3
  • 11
  • 1
    What worked for me is to deactivate breakpoints -> when you are in devtools -> Ctrl + F8 or the button next to "resume script execution" – Kacper Wolkowski Apr 09 '19 at 11:50

3 Answers3

29

Right-click the line number column next to the line that includes the debugger statement and select Never Pause Here.

Do this for each instance of debugger.

never pause here screenshot

Unfortunately, I don't think there's a way to disable the debugger keyword outright, so I understand that this solution is tedious if you have a lot of calls to debugger, but it's the best we have at the moment. I mentioned to the DevTools team (I'm the DevTools technical writer) the need to be able to disable the debugger keyword outright.

Update A DevTools engineer also reminded me that we have the Force Resume button. Hold the Resume button then select Force Resume and DevTools ignores all subsequent breakpoints.

force resume
(source: google.com)

documentation

If the script is in a separate file, you can also blackbox that script.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
  • 3
    is it possible that my chrome does not have the **Never stop here** option? cause I can't see it where you show it :( – Scaramouche Apr 04 '19 at 00:14
  • It seems that it's possible to disable the `debugger` keyword now, I don't know how, but on drive.google.com, I needed to do `debugger` and it didn't work. – Shayan Feb 01 '20 at 13:13
6

You can deactivate breakpoints: Ctrl + F8

hf02
  • 171
  • 2
  • 11
Ucenxyz
  • 61
  • 1
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 21 '21 at 19:10
0

I faced the same issue, tried all options and then realised that issue was because one of the Chrome extensions!

Try to disable extensions one by one.