Reputation: 1580
Can I manually set breakpoints from my code(like by writing console.debug at that point).
Debugging problems with cache, it's important to breakpoint there the first time I load it. If I have to add a breakpoint then reload, I can't test caching(problems with functions not defined on first-load, but working subsequently).
Upvotes: 0
Views: 124
Reputation: 7742
You can override console.debug
and set debugger
there, so we can change it to below
var debugCopy = console.debug.bind(console)
console.debug = function(){
debugger;
return debugCopy.apply(console,arguments)
}
Upvotes: 0
Reputation: 1818
See google documentation. Just write debugger
in your code, and Chrome will pause execution there.
Manual breakpoints are individual breakpoints that you set on a specific line of code. You can set these via the Chrome DevTools GUI, or by inserting the debugger keyword in your code.
Upvotes: 3