4

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?

DuduAlul
  • 6,313
  • 7
  • 39
  • 63
  • 1
    This is very interesting, I didnt even this was possible. Can you provide the full code including where you get debuggeeId from ? – tomdemuyt Jul 12 '12 at 17:27
  • @DuduAlul Can you please add more code here suggesting what is scriptId, debuggeeId, lineNumber etc. May be you are getting the wrong values of lineNumber. Others will also be able to help if you provide more details. – Sachin Jain May 17 '13 at 06:08
  • possible duplicate of [unable to set web inspector breakpoints after upgrade to Safari 7.0.4, both local and remote](http://stackoverflow.com/questions/24495214/unable-to-set-web-inspector-breakpoints-after-upgrade-to-safari-7-0-4-both-loca) – Paul Sweatte Dec 26 '14 at 17:34

0 Answers0