I am trying to add breakpoints automatically using chrome extension
First I am searching for specific content in the specific scriptId then I add a breakpoint on the same location in the search result
This is the code I use:
chrome.debugger.sendCommand(debuggeeId,"Debugger.searchInContent",
{scriptId:scriptId,query:"function"},function(result){
for(x in result.result){
var lineNumber = result.result[x].lineNumber+1;
chrome.debugger.sendCommand(debuggeeId,"Debugger.setBreakpoint",{location:{scriptId:scriptId,lineNumber:lineNumber }});
}
});
All in all, I am getting breakpoints in wrong places I am not even sure how to check where are the breakpoints but it doesn't stop on the right line for sure...
What do I do wrong?