13

I am trying to style a piece of code that has the debugger keyword in it. I am using the debugging window(IE, FF, Opera) to see CSS style effects but the debugger is stopping every time I refresh the page(as it should).

Can I toggle or disable the debugger keyword through the browser(not by deleting it from my code) so I could do the style I want without it bothering me every time I refresh the page?

myApp.service('User', ['$localStorage', function ($localStorage) {
    debugger;
    this.$storage = $localStorage;
}]);

Thanks

The debugger statement

Randall Flagg
  • 4,834
  • 9
  • 33
  • 45
  • I have no idea why you'd use the debugger statement instead of opening the developer tools and the debugger with `F-12` at need. – Elliott Frisch Oct 26 '14 at 05:07
  • this link may be useful http://stackoverflow.com/questions/6259604/how-do-i-clear-all-firebug-js-breakpoints – ManirajSS Oct 26 '14 at 09:59
  • 1
    @ManirajSS Thanks. I will check this with firefox but it is also not the most straight forward solution. Also I need solutions for Opera and IE if any known. – Randall Flagg Oct 26 '14 at 19:58
  • @ElliottFrisch Sometimes I have some piece of code that I would like to come back later and reinspect it, In order to follow the flow or to see events and for that I like to keep the debugger keyword in the code, until I push to the sourcecontrol. – Randall Flagg Oct 26 '14 at 20:01
  • To disable all breakpoints and debuggers see [disable all breakpoints and debuggers in a browser](https://stackoverflow.com/a/45767986/7487135) – Iman Bahrampour Jul 20 '19 at 07:23

3 Answers3

21

You can now select "Never pause here" from the menu after right-clicking on a line number. It will prevent Chrome from pausing on the debugger statement.

Never pause here

Matt Zeunert
  • 16,075
  • 6
  • 52
  • 78
0

f10 => for pass step by step line

f8 => for pass to another debugger

you can see all styles in chrome performance tab without handling javascript issues

chrome>> inspect(f12) > performance > reload

Inspect(f12)>performance

jvd
  • 150
  • 1
  • 7
-1

You should delete the debugger when it's not being used. It should only be used in the lines of code you are currently testing.... There's no reason to have it in your code when you're not testing the code directly before or after the debugger.

Jacob Turner
  • 1,691
  • 1
  • 11
  • 15
  • 6
    Even though is an general answer for "deleting", the OP searches an answer that does not includes deleting `debugger;` from the code (question specifies "disabling"). – edmundo096 Jul 14 '17 at 14:39