Skip to main content

Session

class Session
extends EventEmitter

The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.

Constructors Jump to heading

new
Jump to headingSession()

Create a new instance of the inspector.Session class. The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.

Jump to headingaddListener(
event: string,
listener: (...args: any[]) => void,
): this
Jump to headingaddListener(
event: "inspectorNotification",
listener: (message: InspectorNotification<object>) => void,
): this

Emitted when any notification from the V8 Inspector is received.

Jump to headingaddListener(
event: "Runtime.executionContextCreated",
): this

Issued when new execution context is created.

Jump to headingaddListener(
event: "Runtime.executionContextDestroyed",
): this

Issued when execution context is destroyed.

Jump to headingaddListener(
event: "Runtime.executionContextsCleared",
listener: () => void,
): this

Issued when all executionContexts were cleared in browser

Jump to headingaddListener(
event: "Runtime.exceptionThrown",
): this

Issued when exception was thrown and unhandled.

Jump to headingaddListener(
event: "Runtime.exceptionRevoked",
): this

Issued when unhandled exception was revoked.

Jump to headingaddListener(
event: "Runtime.consoleAPICalled",
): this

Issued when console API was called.

Jump to headingaddListener(
event: "Runtime.inspectRequested",
): this

Issued when object should be inspected (for example, as a result of inspect() command line API call).

Jump to headingaddListener(
event: "Debugger.scriptParsed",
): this

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

Jump to headingaddListener(
event: "Debugger.scriptFailedToParse",
): this

Fired when virtual machine fails to parse the script.

Jump to headingaddListener(
event: "Debugger.breakpointResolved",
): this

Fired when breakpoint is resolved to an actual script and location.

Jump to headingaddListener(
event: "Debugger.paused",
): this

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

Jump to headingaddListener(
event: "Debugger.resumed",
listener: () => void,
): this

Fired when the virtual machine resumed execution.

Jump to headingaddListener(
event: "Console.messageAdded",
): this

Issued when new console message is added.

Jump to headingaddListener(
event: "Profiler.consoleProfileStarted",
): this

Sent when new profile recording is started using console.profile() call.

Jump to headingaddListener(
event: "Profiler.consoleProfileFinished",
): this
Jump to headingaddListener(
event: "HeapProfiler.addHeapSnapshotChunk",
): this
Jump to headingaddListener(
event: "HeapProfiler.resetProfiles",
listener: () => void,
): this
Jump to headingaddListener(
event: "HeapProfiler.reportHeapSnapshotProgress",
): this
Jump to headingaddListener(
event: "HeapProfiler.lastSeenObjectId",
): this

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.

Jump to headingaddListener(
event: "HeapProfiler.heapStatsUpdate",
): this

If heap objects tracking has been started then backend may send update for one or more fragments

Jump to headingaddListener(
event: "NodeTracing.dataCollected",
): this

Contains an bucket of collected trace events.

Jump to headingaddListener(
event: "NodeTracing.tracingComplete",
listener: () => void,
): this

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Jump to headingaddListener(
event: "NodeWorker.attachedToWorker",
): this

Issued when attached to a worker.

Jump to headingaddListener(
event: "NodeWorker.detachedFromWorker",
): this

Issued when detached from the worker.

Jump to headingaddListener(
event: "NodeWorker.receivedMessageFromWorker",
): this

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

Jump to headingaddListener(
event: "Network.requestWillBeSent",
): this

Fired when page is about to send HTTP request.

Jump to headingaddListener(
event: "Network.responseReceived",
): this

Fired when HTTP response is available.

Jump to headingaddListener(
event: "Network.loadingFailed",
): this
Jump to headingaddListener(
event: "Network.loadingFinished",
): this
Jump to headingaddListener(
event: "NodeRuntime.waitingForDisconnect",
listener: () => void,
): this

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.

Jump to headingaddListener(
event: "NodeRuntime.waitingForDebugger",
listener: () => void,
): this

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

Connects a session to the inspector back-end.

Connects a session to the inspector back-end. An exception will be thrown if this API was not called on a Worker thread.

Immediately close the session. All pending message callbacks will be called with an error. session.connect() will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.

Jump to headingemit(
event: string | symbol,
...args: any[],
): boolean
Jump to headingemit(
event: "inspectorNotification",
message: InspectorNotification<object>,
): boolean
Jump to headingemit(
event: "Runtime.executionContextCreated",
): boolean
Jump to headingemit(
event: "Runtime.executionContextDestroyed",
): boolean
Jump to headingemit(event: "Runtime.executionContextsCleared"): boolean
Jump to headingemit(
event: "Runtime.exceptionThrown",
): boolean
Jump to headingemit(
event: "Runtime.exceptionRevoked",
): boolean
Jump to headingemit(
event: "Runtime.consoleAPICalled",
): boolean
Jump to headingemit(
event: "Runtime.inspectRequested",
): boolean
Jump to headingemit(
event: "Debugger.scriptParsed",
): boolean
Jump to headingemit(
event: "Debugger.scriptFailedToParse",
): boolean
Jump to headingemit(
event: "Debugger.breakpointResolved",
): boolean
Jump to headingemit(
event: "Debugger.paused",
): boolean
Jump to headingemit(event: "Debugger.resumed"): boolean
Jump to headingemit(
event: "Console.messageAdded",
): boolean
Jump to headingemit(
event: "Profiler.consoleProfileStarted",
): boolean
Jump to headingemit(
event: "Profiler.consoleProfileFinished",
): boolean
Jump to headingemit(
event: "HeapProfiler.addHeapSnapshotChunk",
): boolean
Jump to headingemit(event: "HeapProfiler.resetProfiles"): boolean
Jump to headingemit(
event: "HeapProfiler.reportHeapSnapshotProgress",
): boolean
Jump to headingemit(
event: "HeapProfiler.lastSeenObjectId",
): boolean
Jump to headingemit(
event: "HeapProfiler.heapStatsUpdate",
): boolean
Jump to headingemit(
event: "NodeTracing.dataCollected",
): boolean
Jump to headingemit(event: "NodeTracing.tracingComplete"): boolean
Jump to headingemit(
event: "NodeWorker.attachedToWorker",
): boolean
Jump to headingemit(
event: "NodeWorker.detachedFromWorker",
): boolean
Jump to headingemit(
event: "NodeWorker.receivedMessageFromWorker",
): boolean
Jump to headingemit(
event: "Network.requestWillBeSent",
): boolean
Jump to headingemit(
event: "Network.responseReceived",
): boolean
Jump to headingemit(
event: "Network.loadingFailed",
): boolean
Jump to headingemit(
event: "Network.loadingFinished",
): boolean
Jump to headingemit(event: "NodeRuntime.waitingForDisconnect"): boolean
Jump to headingemit(event: "NodeRuntime.waitingForDebugger"): boolean
Jump to headingon(
event: string,
listener: (...args: any[]) => void,
): this
Jump to headingon(
event: "inspectorNotification",
listener: (message: InspectorNotification<object>) => void,
): this

Emitted when any notification from the V8 Inspector is received.

Jump to headingon(
event: "Runtime.executionContextCreated",
): this

Issued when new execution context is created.

Jump to headingon(
event: "Runtime.executionContextDestroyed",
): this

Issued when execution context is destroyed.

Jump to headingon(
event: "Runtime.executionContextsCleared",
listener: () => void,
): this

Issued when all executionContexts were cleared in browser

Jump to headingon(
event: "Runtime.exceptionThrown",
): this

Issued when exception was thrown and unhandled.

Jump to headingon(
event: "Runtime.exceptionRevoked",
): this

Issued when unhandled exception was revoked.

Jump to headingon(
event: "Runtime.consoleAPICalled",
): this

Issued when console API was called.

Jump to headingon(
event: "Runtime.inspectRequested",
): this

Issued when object should be inspected (for example, as a result of inspect() command line API call).

Jump to headingon(
event: "Debugger.scriptParsed",
): this

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

Jump to headingon(
event: "Debugger.scriptFailedToParse",
): this

Fired when virtual machine fails to parse the script.

Jump to headingon(
event: "Debugger.breakpointResolved",
): this

Fired when breakpoint is resolved to an actual script and location.

Jump to headingon(
event: "Debugger.paused",
): this

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

Jump to headingon(
event: "Debugger.resumed",
listener: () => void,
): this

Fired when the virtual machine resumed execution.

Jump to headingon(
event: "Console.messageAdded",
): this

Issued when new console message is added.

Jump to headingon(
event: "Profiler.consoleProfileStarted",
): this

Sent when new profile recording is started using console.profile() call.

Jump to headingon(
event: "Profiler.consoleProfileFinished",
): this
Jump to headingon(
event: "HeapProfiler.addHeapSnapshotChunk",
): this
Jump to headingon(
event: "HeapProfiler.resetProfiles",
listener: () => void,
): this
Jump to headingon(
event: "HeapProfiler.reportHeapSnapshotProgress",
): this
Jump to headingon(
event: "HeapProfiler.lastSeenObjectId",
): this

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.

Jump to headingon(
event: "HeapProfiler.heapStatsUpdate",
): this

If heap objects tracking has been started then backend may send update for one or more fragments

Jump to headingon(
event: "NodeTracing.dataCollected",
): this

Contains an bucket of collected trace events.

Jump to headingon(
event: "NodeTracing.tracingComplete",
listener: () => void,
): this

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Jump to headingon(
event: "NodeWorker.attachedToWorker",
): this

Issued when attached to a worker.

Jump to headingon(
event: "NodeWorker.detachedFromWorker",
): this

Issued when detached from the worker.

Jump to headingon(
event: "NodeWorker.receivedMessageFromWorker",
): this

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

Jump to headingon(
event: "Network.requestWillBeSent",
): this

Fired when page is about to send HTTP request.

Jump to headingon(
event: "Network.responseReceived",
): this

Fired when HTTP response is available.

Jump to headingon(
event: "Network.loadingFailed",
): this
Jump to headingon(
event: "Network.loadingFinished",
): this
Jump to headingon(
event: "NodeRuntime.waitingForDisconnect",
listener: () => void,
): this

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.

Jump to headingon(
event: "NodeRuntime.waitingForDebugger",
listener: () => void,
): this

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

Jump to headingonce(
event: string,
listener: (...args: any[]) => void,
): this
Jump to headingonce(
event: "inspectorNotification",
listener: (message: InspectorNotification<object>) => void,
): this

Emitted when any notification from the V8 Inspector is received.

Jump to headingonce(
event: "Runtime.executionContextCreated",
): this

Issued when new execution context is created.

Jump to headingonce(
event: "Runtime.executionContextDestroyed",
): this

Issued when execution context is destroyed.

Jump to headingonce(
event: "Runtime.executionContextsCleared",
listener: () => void,
): this

Issued when all executionContexts were cleared in browser

Jump to headingonce(
event: "Runtime.exceptionThrown",
): this

Issued when exception was thrown and unhandled.

Jump to headingonce(
event: "Runtime.exceptionRevoked",
): this

Issued when unhandled exception was revoked.

Jump to headingonce(
event: "Runtime.consoleAPICalled",
): this

Issued when console API was called.

Jump to headingonce(
event: "Runtime.inspectRequested",
): this

Issued when object should be inspected (for example, as a result of inspect() command line API call).

Jump to headingonce(
event: "Debugger.scriptParsed",
): this

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

Jump to headingonce(
event: "Debugger.scriptFailedToParse",
): this

Fired when virtual machine fails to parse the script.

Jump to headingonce(
event: "Debugger.breakpointResolved",
): this

Fired when breakpoint is resolved to an actual script and location.

Jump to headingonce(
event: "Debugger.paused",
): this

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

Jump to headingonce(
event: "Debugger.resumed",
listener: () => void,
): this

Fired when the virtual machine resumed execution.

Jump to headingonce(
event: "Console.messageAdded",
): this

Issued when new console message is added.

Jump to headingonce(
event: "Profiler.consoleProfileStarted",
): this

Sent when new profile recording is started using console.profile() call.

Jump to headingonce(
event: "Profiler.consoleProfileFinished",
): this
Jump to headingonce(
event: "HeapProfiler.addHeapSnapshotChunk",
): this
Jump to headingonce(
event: "HeapProfiler.resetProfiles",
listener: () => void,
): this
Jump to headingonce(
event: "HeapProfiler.reportHeapSnapshotProgress",
): this
Jump to headingonce(
event: "HeapProfiler.lastSeenObjectId",
): this

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.

Jump to headingonce(
event: "HeapProfiler.heapStatsUpdate",
): this

If heap objects tracking has been started then backend may send update for one or more fragments

Jump to headingonce(
event: "NodeTracing.dataCollected",
): this

Contains an bucket of collected trace events.

Jump to headingonce(
event: "NodeTracing.tracingComplete",
listener: () => void,
): this

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Jump to headingonce(
event: "NodeWorker.attachedToWorker",
): this

Issued when attached to a worker.

Jump to headingonce(
event: "NodeWorker.detachedFromWorker",
): this

Issued when detached from the worker.

Jump to headingonce(
event: "NodeWorker.receivedMessageFromWorker",
): this

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

Jump to headingonce(
event: "Network.requestWillBeSent",
): this

Fired when page is about to send HTTP request.

Jump to headingonce(
event: "Network.responseReceived",
): this

Fired when HTTP response is available.

Jump to headingonce(
event: "Network.loadingFailed",
): this
Jump to headingonce(
event: "Network.loadingFinished",
): this
Jump to headingonce(
event: "NodeRuntime.waitingForDisconnect",
listener: () => void,
): this

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.

Jump to headingonce(
event: "NodeRuntime.waitingForDebugger",
listener: () => void,
): this

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

Jump to headingpost(
method: string,
callback?: (
err: Error | null,
params?: object,
) => void
,
): void

Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments: error and message-specific result.

session.post('Runtime.evaluate', { expression: '2 + 2' },
             (error, { result }) => console.log(result));
// Output: { type: 'number', value: 4, description: '4' }

The latest version of the V8 inspector protocol is published on the Chrome DevTools Protocol Viewer.

Node.js inspector supports all the Chrome DevTools Protocol domains declared by V8. Chrome DevTools Protocol domain provides an interface for interacting with one of the runtime agents used to inspect the application state and listen to the run-time events.

Jump to headingpost(
method: string,
params?: object,
callback?: (
err: Error | null,
params?: object,
) => void
,
): void
Jump to headingpost(
method: "Schema.getDomains",
callback?: (
err: Error | null,
) => void
,
): void

Returns supported domains.

Jump to headingpost(
method: "Runtime.evaluate",
callback?: (
err: Error | null,
) => void
,
): void

Evaluates expression on global object.

Jump to headingpost(
method: "Runtime.evaluate",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.awaitPromise",
callback?: (
err: Error | null,
) => void
,
): void

Add handler to promise with given promise object id.

Jump to headingpost(
method: "Runtime.awaitPromise",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.callFunctionOn",
callback?: (
err: Error | null,
) => void
,
): void

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Jump to headingpost(
method: "Runtime.callFunctionOn",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.getProperties",
callback?: (
err: Error | null,
) => void
,
): void

Returns properties of a given object. Object group of the result is inherited from the target object.

Jump to headingpost(
method: "Runtime.getProperties",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.releaseObject",
callback?: (err: Error | null) => void,
): void

Releases remote object with given id.

Jump to headingpost(
method: "Runtime.releaseObject",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Runtime.releaseObjectGroup",
callback?: (err: Error | null) => void,
): void

Releases all remote objects that belong to a given group.

Jump to headingpost(
method: "Runtime.releaseObjectGroup",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Runtime.runIfWaitingForDebugger",
callback?: (err: Error | null) => void,
): void

Tells inspected instance to run if it was waiting for debugger to attach.

Jump to headingpost(
method: "Runtime.enable",
callback?: (err: Error | null) => void,
): void

Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

Jump to headingpost(
method: "Runtime.disable",
callback?: (err: Error | null) => void,
): void

Disables reporting of execution contexts creation.

Jump to headingpost(
method: "Runtime.discardConsoleEntries",
callback?: (err: Error | null) => void,
): void

Discards collected exceptions and console API calls.

Jump to headingpost(
method: "Runtime.setCustomObjectFormatterEnabled",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Runtime.setCustomObjectFormatterEnabled",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Runtime.compileScript",
callback?: (
err: Error | null,
) => void
,
): void

Compiles expression.

Jump to headingpost(
method: "Runtime.compileScript",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.runScript",
callback?: (
err: Error | null,
) => void
,
): void

Runs script with given id in a given context.

Jump to headingpost(
method: "Runtime.runScript",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.queryObjects",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.queryObjects",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Runtime.globalLexicalScopeNames",
callback?: () => void,
): void

Returns all let, const and class variables from global scope.

Jump to headingpost(
method: "Runtime.globalLexicalScopeNames",
callback?: () => void,
): void
Jump to headingpost(
method: "Debugger.enable",
callback?: (
err: Error | null,
) => void
,
): void

Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.

Jump to headingpost(
method: "Debugger.disable",
callback?: (err: Error | null) => void,
): void

Disables debugger for given page.

Jump to headingpost(
method: "Debugger.setBreakpointsActive",
callback?: (err: Error | null) => void,
): void

Activates / deactivates all breakpoints on the page.

Jump to headingpost(
method: "Debugger.setBreakpointsActive",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setSkipAllPauses",
callback?: (err: Error | null) => void,
): void

Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

Jump to headingpost(
method: "Debugger.setSkipAllPauses",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setBreakpointByUrl",
callback?: (
err: Error | null,
) => void
,
): void

Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

Jump to headingpost(
method: "Debugger.setBreakpointByUrl",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.setBreakpoint",
callback?: (
err: Error | null,
) => void
,
): void

Sets JavaScript breakpoint at a given location.

Jump to headingpost(
method: "Debugger.setBreakpoint",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.removeBreakpoint",
callback?: (err: Error | null) => void,
): void

Removes JavaScript breakpoint.

Jump to headingpost(
method: "Debugger.removeBreakpoint",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.getPossibleBreakpoints",
callback?: () => void,
): void

Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

Jump to headingpost(
method: "Debugger.getPossibleBreakpoints",
callback?: () => void,
): void
Jump to headingpost(
method: "Debugger.continueToLocation",
callback?: (err: Error | null) => void,
): void

Continues execution until specific location is reached.

Jump to headingpost(
method: "Debugger.continueToLocation",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.pauseOnAsyncCall",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.pauseOnAsyncCall",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.stepOver",
callback?: (err: Error | null) => void,
): void

Steps over the statement.

Jump to headingpost(
method: "Debugger.stepInto",
callback?: (err: Error | null) => void,
): void

Steps into the function call.

Jump to headingpost(
method: "Debugger.stepInto",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.stepOut",
callback?: (err: Error | null) => void,
): void

Steps out of the function call.

Jump to headingpost(
method: "Debugger.pause",
callback?: (err: Error | null) => void,
): void

Stops on the next JavaScript statement.

Jump to headingpost(
method: "Debugger.scheduleStepIntoAsync",
callback?: (err: Error | null) => void,
): void

This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.

Jump to headingpost(
method: "Debugger.resume",
callback?: (err: Error | null) => void,
): void

Resumes JavaScript execution.

Jump to headingpost(
method: "Debugger.getStackTrace",
callback?: (
err: Error | null,
) => void
,
): void

Returns stack trace with given stackTraceId.

Jump to headingpost(
method: "Debugger.getStackTrace",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.searchInContent",
callback?: (
err: Error | null,
) => void
,
): void

Searches for given string in script content.

Jump to headingpost(
method: "Debugger.searchInContent",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.setScriptSource",
callback?: (
err: Error | null,
) => void
,
): void

Edits JavaScript source live.

Jump to headingpost(
method: "Debugger.setScriptSource",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.restartFrame",
callback?: (
err: Error | null,
) => void
,
): void

Restarts particular call frame from the beginning.

Jump to headingpost(
method: "Debugger.restartFrame",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.getScriptSource",
callback?: (
err: Error | null,
) => void
,
): void

Returns source for the script with given id.

Jump to headingpost(
method: "Debugger.getScriptSource",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.setPauseOnExceptions",
callback?: (err: Error | null) => void,
): void

Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none.

Jump to headingpost(
method: "Debugger.setPauseOnExceptions",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.evaluateOnCallFrame",
callback?: (
err: Error | null,
) => void
,
): void

Evaluates expression on a given call frame.

Jump to headingpost(
method: "Debugger.evaluateOnCallFrame",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Debugger.setVariableValue",
callback?: (err: Error | null) => void,
): void

Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

Jump to headingpost(
method: "Debugger.setVariableValue",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setReturnValue",
callback?: (err: Error | null) => void,
): void

Changes return value in top frame. Available only at return break position.

Jump to headingpost(
method: "Debugger.setReturnValue",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setAsyncCallStackDepth",
callback?: (err: Error | null) => void,
): void

Enables or disables async call stacks tracking.

Jump to headingpost(
method: "Debugger.setAsyncCallStackDepth",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setBlackboxPatterns",
callback?: (err: Error | null) => void,
): void

Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

Jump to headingpost(
method: "Debugger.setBlackboxPatterns",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Debugger.setBlackboxedRanges",
callback?: (err: Error | null) => void,
): void

Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.

Jump to headingpost(
method: "Debugger.setBlackboxedRanges",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Console.enable",
callback?: (err: Error | null) => void,
): void

Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification.

Jump to headingpost(
method: "Console.disable",
callback?: (err: Error | null) => void,
): void

Disables console domain, prevents further console messages from being reported to the client.

Jump to headingpost(
method: "Console.clearMessages",
callback?: (err: Error | null) => void,
): void

Does nothing.

Jump to headingpost(
method: "Profiler.enable",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Profiler.disable",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Profiler.setSamplingInterval",
callback?: (err: Error | null) => void,
): void

Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

Jump to headingpost(
method: "Profiler.setSamplingInterval",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Profiler.start",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Profiler.stop",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "Profiler.startPreciseCoverage",
callback?: (err: Error | null) => void,
): void

Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.

Jump to headingpost(
method: "Profiler.startPreciseCoverage",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Profiler.stopPreciseCoverage",
callback?: (err: Error | null) => void,
): void

Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

Jump to headingpost(
method: "Profiler.takePreciseCoverage",
callback?: (
err: Error | null,
) => void
,
): void

Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.

Jump to headingpost(
method: "Profiler.getBestEffortCoverage",
callback?: (
err: Error | null,
) => void
,
): void

Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.

Jump to headingpost(
method: "HeapProfiler.enable",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.disable",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.startTrackingHeapObjects",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.startTrackingHeapObjects",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.stopTrackingHeapObjects",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.stopTrackingHeapObjects",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.takeHeapSnapshot",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.takeHeapSnapshot",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.collectGarbage",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.getObjectByHeapObjectId",
callback?: () => void,
): void
Jump to headingpost(
method: "HeapProfiler.getObjectByHeapObjectId",
callback?: () => void,
): void
Jump to headingpost(
method: "HeapProfiler.addInspectedHeapObject",
callback?: (err: Error | null) => void,
): void

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

Jump to headingpost(
method: "HeapProfiler.addInspectedHeapObject",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.getHeapObjectId",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "HeapProfiler.getHeapObjectId",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "HeapProfiler.startSampling",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.startSampling",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "HeapProfiler.stopSampling",
callback?: (
err: Error | null,
) => void
,
): void
Jump to headingpost(
method: "HeapProfiler.getSamplingProfile",
callback?: () => void,
): void
Jump to headingpost(
method: "NodeTracing.getCategories",
callback?: (
err: Error | null,
) => void
,
): void

Gets supported tracing categories.

Jump to headingpost(
method: "NodeTracing.start",
callback?: (err: Error | null) => void,
): void

Start trace events collection.

Jump to headingpost(
method: "NodeTracing.start",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "NodeTracing.stop",
callback?: (err: Error | null) => void,
): void

Stop trace events collection. Remaining collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.

Jump to headingpost(
method: "NodeWorker.sendMessageToWorker",
callback?: (err: Error | null) => void,
): void

Sends protocol message over session with given id.

Jump to headingpost(
method: "NodeWorker.sendMessageToWorker",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "NodeWorker.enable",
callback?: (err: Error | null) => void,
): void

Instructs the inspector to attach to running workers. Will also attach to new workers as they start

Jump to headingpost(
method: "NodeWorker.enable",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "NodeWorker.disable",
callback?: (err: Error | null) => void,
): void

Detaches from all running workers and disables attaching to new workers as they are started.

Jump to headingpost(
method: "NodeWorker.detach",
callback?: (err: Error | null) => void,
): void

Detached from the worker with given sessionId.

Jump to headingpost(
method: "NodeWorker.detach",
callback?: (err: Error | null) => void,
): void
Jump to headingpost(
method: "Network.disable",
callback?: (err: Error | null) => void,
): void

Disables network tracking, prevents network events from being sent to the client.

Jump to headingpost(
method: "Network.enable",
callback?: (err: Error | null) => void,
): void

Enables network tracking, network events will now be delivered to the client.

Jump to headingpost(
method: "NodeRuntime.enable",
callback?: (err: Error | null) => void,
): void

Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect.

Jump to headingpost(
method: "NodeRuntime.disable",
callback?: (err: Error | null) => void,
): void

Disable NodeRuntime events

Jump to headingpost(
method: "NodeRuntime.notifyWhenWaitingForDisconnect",
callback?: (err: Error | null) => void,
): void

Enable the NodeRuntime.waitingForDisconnect.

Jump to headingpost(
method: "NodeRuntime.notifyWhenWaitingForDisconnect",
callback?: (err: Error | null) => void,
): void
Jump to headingprependListener(
event: string,
listener: (...args: any[]) => void,
): this
Jump to headingprependListener(
event: "inspectorNotification",
listener: (message: InspectorNotification<object>) => void,
): this

Emitted when any notification from the V8 Inspector is received.

Jump to headingprependListener(
event: "Runtime.executionContextCreated",
): this

Issued when new execution context is created.

Jump to headingprependListener(
event: "Runtime.executionContextDestroyed",
): this

Issued when execution context is destroyed.

Jump to headingprependListener(
event: "Runtime.executionContextsCleared",
listener: () => void,
): this

Issued when all executionContexts were cleared in browser

Jump to headingprependListener(
event: "Runtime.exceptionThrown",
): this

Issued when exception was thrown and unhandled.

Jump to headingprependListener(
event: "Runtime.exceptionRevoked",
): this

Issued when unhandled exception was revoked.

Jump to headingprependListener(
event: "Runtime.consoleAPICalled",
): this

Issued when console API was called.

Jump to headingprependListener(
event: "Runtime.inspectRequested",
): this

Issued when object should be inspected (for example, as a result of inspect() command line API call).

Jump to headingprependListener(
event: "Debugger.scriptParsed",
): this

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

Jump to headingprependListener(
event: "Debugger.scriptFailedToParse",
): this

Fired when virtual machine fails to parse the script.

Jump to headingprependListener(
event: "Debugger.breakpointResolved",
): this

Fired when breakpoint is resolved to an actual script and location.

Jump to headingprependListener(
event: "Debugger.paused",
): this

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

Jump to headingprependListener(
event: "Debugger.resumed",
listener: () => void,
): this

Fired when the virtual machine resumed execution.

Jump to headingprependListener(
event: "Console.messageAdded",
): this

Issued when new console message is added.

Jump to headingprependListener(
event: "Profiler.consoleProfileStarted",
): this

Sent when new profile recording is started using console.profile() call.

Jump to headingprependListener(
event: "Profiler.consoleProfileFinished",
): this
Jump to headingprependListener(
event: "HeapProfiler.addHeapSnapshotChunk",
): this
Jump to headingprependListener(
event: "HeapProfiler.resetProfiles",
listener: () => void,
): this
Jump to headingprependListener(
event: "HeapProfiler.reportHeapSnapshotProgress",
): this
Jump to headingprependListener(
event: "HeapProfiler.lastSeenObjectId",
): this

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.

Jump to headingprependListener(
event: "HeapProfiler.heapStatsUpdate",
): this

If heap objects tracking has been started then backend may send update for one or more fragments

Jump to headingprependListener(
event: "NodeTracing.dataCollected",
): this

Contains an bucket of collected trace events.

Jump to headingprependListener(
event: "NodeTracing.tracingComplete",
listener: () => void,
): this

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Jump to headingprependListener(
event: "NodeWorker.attachedToWorker",
): this

Issued when attached to a worker.

Jump to headingprependListener(
event: "NodeWorker.detachedFromWorker",
): this

Issued when detached from the worker.

Jump to headingprependListener(
event: "NodeWorker.receivedMessageFromWorker",
): this

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

Jump to headingprependListener(
event: "Network.requestWillBeSent",
): this

Fired when page is about to send HTTP request.

Jump to headingprependListener(
event: "Network.responseReceived",
): this

Fired when HTTP response is available.

Jump to headingprependListener(
event: "Network.loadingFailed",
): this
Jump to headingprependListener(
event: "Network.loadingFinished",
): this
Jump to headingprependListener(
event: "NodeRuntime.waitingForDisconnect",
listener: () => void,
): this

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.

Jump to headingprependListener(
event: "NodeRuntime.waitingForDebugger",
listener: () => void,
): this

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

Jump to headingprependOnceListener(
event: string,
listener: (...args: any[]) => void,
): this
Jump to headingprependOnceListener(
event: "inspectorNotification",
listener: (message: InspectorNotification<object>) => void,
): this

Emitted when any notification from the V8 Inspector is received.

Jump to headingprependOnceListener(
event: "Runtime.executionContextCreated",
): this

Issued when new execution context is created.

Jump to headingprependOnceListener(
event: "Runtime.executionContextDestroyed",
): this

Issued when execution context is destroyed.

Jump to headingprependOnceListener(
event: "Runtime.executionContextsCleared",
listener: () => void,
): this

Issued when all executionContexts were cleared in browser

Jump to headingprependOnceListener(
event: "Runtime.exceptionThrown",
): this

Issued when exception was thrown and unhandled.

Jump to headingprependOnceListener(
event: "Runtime.exceptionRevoked",
): this

Issued when unhandled exception was revoked.

Jump to headingprependOnceListener(
event: "Runtime.consoleAPICalled",
): this

Issued when console API was called.

Jump to headingprependOnceListener(
event: "Runtime.inspectRequested",
): this

Issued when object should be inspected (for example, as a result of inspect() command line API call).

Jump to headingprependOnceListener(
event: "Debugger.scriptParsed",
): this

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

Jump to headingprependOnceListener(
event: "Debugger.scriptFailedToParse",
): this

Fired when virtual machine fails to parse the script.

Jump to headingprependOnceListener(
event: "Debugger.breakpointResolved",
): this

Fired when breakpoint is resolved to an actual script and location.

Jump to headingprependOnceListener(
event: "Debugger.paused",
): this

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

Jump to headingprependOnceListener(
event: "Debugger.resumed",
listener: () => void,
): this

Fired when the virtual machine resumed execution.

Jump to headingprependOnceListener(
event: "Console.messageAdded",
): this

Issued when new console message is added.

Jump to headingprependOnceListener(
event: "Profiler.consoleProfileStarted",
): this

Sent when new profile recording is started using console.profile() call.

Jump to headingprependOnceListener(
event: "Profiler.consoleProfileFinished",
): this
Jump to headingprependOnceListener(
event: "HeapProfiler.addHeapSnapshotChunk",
): this
Jump to headingprependOnceListener(
event: "HeapProfiler.resetProfiles",
listener: () => void,
): this
Jump to headingprependOnceListener(
event: "HeapProfiler.reportHeapSnapshotProgress",
): this
Jump to headingprependOnceListener(
event: "HeapProfiler.lastSeenObjectId",
): this

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.

Jump to headingprependOnceListener(
event: "HeapProfiler.heapStatsUpdate",
): this

If heap objects tracking has been started then backend may send update for one or more fragments

Jump to headingprependOnceListener(
event: "NodeTracing.dataCollected",
): this

Contains an bucket of collected trace events.

Jump to headingprependOnceListener(
event: "NodeTracing.tracingComplete",
listener: () => void,
): this

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

Jump to headingprependOnceListener(
event: "NodeWorker.attachedToWorker",
): this

Issued when attached to a worker.

Jump to headingprependOnceListener(
event: "NodeWorker.detachedFromWorker",
): this

Issued when detached from the worker.

Jump to headingprependOnceListener(
event: "NodeWorker.receivedMessageFromWorker",
): this

Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).

Jump to headingprependOnceListener(
event: "Network.requestWillBeSent",
): this

Fired when page is about to send HTTP request.

Jump to headingprependOnceListener(
event: "Network.responseReceived",
): this

Fired when HTTP response is available.

Jump to headingprependOnceListener(
event: "Network.loadingFailed",
): this
Jump to headingprependOnceListener(
event: "Network.loadingFinished",
): this
Jump to headingprependOnceListener(
event: "NodeRuntime.waitingForDisconnect",
listener: () => void,
): this

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.

Jump to headingprependOnceListener(
event: "NodeRuntime.waitingForDebugger",
listener: () => void,
): this

This event is fired when the runtime is waiting for the debugger. For example, when inspector.waitingForDebugger is called

Back to top