method
inspector.Session.on
Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aThe name of the event.
The callback function
Emitted when any notification from the V8 Inspector is received.
Issued when all executionContexts were cleared in browser
Issued when object should be inspected (for example, as a result of inspect() command line API call).
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
Fired when virtual machine fails to parse the script.
Fired when breakpoint is resolved to an actual script and location.
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
Fired when the virtual machine resumed execution.
Sent when new profile recording is started using console.profile() call.
If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
If heap objects tracking has been started then backend may send update for one or more fragments
Fired when WebSocket handshake response becomes available.
This event is fired instead of Runtime.executionContextDestroyed when enabled. It is fired when the Node process finished all code execution and is waiting for all frontends to disconnect.
This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called
Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).