debugging - How to dynamically create a breakpoint on an expression in chrome? -
debugging - How to dynamically create a breakpoint on an expression in chrome? -
say have code in production. want test particular item in big list of items has behavior. 1 way accomplish in development debugger
statement this:
items.foreach(function(item){ // code... if (item.title.match(/foo/)) { debugger; } // more code... });
with code, set breakpoint in list, when list item matches expression. makes easy debug 1 item, may have obscure bug in it. if seek set breakpoint there clicking line, it's going pause @ every item in list, have step through 100 items before there super tedious.
one problem above is, requires have ability edit client-side javascript, can't in production.
so question is, can accomplish same sort of thing, purely using chrome web inspector? maybe "watch expressions" (haven't found much on google those). ideal be, within chrome web inspector, add together look like:
breakpoint: line: 17 file: build.js expression: item.title.match(/foo/)
the closest without getting chrome's chrome.debugger
apis conditional breakpoints.
if want programmatically, chrome.debugger.sendcommand
debugger.setbreakpoint
command.
debugging google-chrome-devtools breakpoints
Comments
Post a Comment