我正在尝试编写影响Chrome控制台调试模式中断点的javascript代码。
类似的东西:
function someJavascriptCode() {
console.log('will stop here for debugging');
debugger; // stop!
chrome.debugger.stepOver(); // just like clicking F10 in the console when in a breakpoint
console.log('This line just happened because of the previous line');
}
有什么想法吗?
答案 0 :(得分:1)
没有类似的东西被实现,也不可能以那种方式实现,因为在运行时代码中有控制调试器的函数没有任何意义。它可能是用某种指令完成的,但我怀疑存在这样的情况,我真的不能想到任何真正的用例。
如果您希望在外部执行此操作,可能需要查看remote debugging protocol或撰写debugger extension。