事件:;
【Event: <inspector-protocol-method>;】
- 类型:<Object> 通知消息对象
当收到方法字段设置为 <inspector-protocol-method> 的检查器通知时触发。
【Emitted when an inspector notification is received that has its method field set
to the <inspector-protocol-method> value.】
以下代码片段在 'Debugger.paused' 事件上安装了一个监听器,并在程序执行被暂停时(例如通过断点)打印程序暂停的原因:
【The following snippet installs a listener on the 'Debugger.paused'
event, and prints the reason for program suspension whenever program
execution is suspended (through breakpoints, for example):】
session.on('Debugger.paused', ({ params }) => {
console.log(params.hitBreakpoints);
});
// [ '/the/file/that/has/the/breakpoint.js:11:0' ] 注意 不建议在同一线程会话中使用断点,请参阅 断点支持。