Usage in Deno
import { Session } from "node:inspector/promises";
The inspector.Session
is used for dispatching messages to the V8 inspector
back-end and receiving message responses and notifications.
addListener(event: string,listener: (...args: any[]) => void,): this
addListener(event: "inspectorNotification",listener: (message: InspectorNotification<object>) => void,): this
Emitted when any notification from the V8 Inspector is received.
addListener(event: "Runtime.executionContextCreated",listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void,): this
Issued when new execution context is created.
addListener(event: "Runtime.executionContextDestroyed",listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void,): this
Issued when execution context is destroyed.
addListener(event: "Runtime.executionContextsCleared",listener: () => void,): this
Issued when all executionContexts were cleared in browser
addListener(event: "Runtime.exceptionThrown",listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void,): this
Issued when exception was thrown and unhandled.
addListener(event: "Runtime.exceptionRevoked",listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void,): this
Issued when unhandled exception was revoked.
addListener(event: "Runtime.consoleAPICalled",listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void,): this
Issued when console API was called.
addListener(event: "Runtime.inspectRequested",listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void,): this
Issued when object should be inspected (for example, as a result of inspect() command line API call).
addListener(event: "Debugger.scriptParsed",listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void,): this
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
addListener(event: "Debugger.scriptFailedToParse",listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void,): this
Fired when virtual machine fails to parse the script.
addListener(event: "Debugger.breakpointResolved",listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void,): this
Fired when breakpoint is resolved to an actual script and location.
addListener(event: "Debugger.paused",listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void,): this
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
addListener(event: "Debugger.resumed",listener: () => void,): this
Fired when the virtual machine resumed execution.
addListener(event: "Console.messageAdded",listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void,): this
Issued when new console message is added.
addListener(event: "Profiler.consoleProfileStarted",listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void,): this
Sent when new profile recording is started using console.profile() call.
addListener(event: "Profiler.consoleProfileFinished",listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void,): this
addListener(event: "HeapProfiler.addHeapSnapshotChunk",listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void,): this
addListener(event: "HeapProfiler.resetProfiles",listener: () => void,): this
addListener(event: "HeapProfiler.reportHeapSnapshotProgress",listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void,): this
addListener(event: "HeapProfiler.lastSeenObjectId",listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void,): 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.
addListener(event: "HeapProfiler.heapStatsUpdate",listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void,): this
If heap objects tracking has been started then backend may send update for one or more fragments
addListener(event: "NodeTracing.dataCollected",listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void,): this
Contains an bucket of collected trace events.
addListener(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.
addListener(event: "NodeWorker.attachedToWorker",listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void,): this
Issued when attached to a worker.
addListener(event: "NodeWorker.detachedFromWorker",listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void,): this
Issued when detached from the worker.
addListener(event: "NodeWorker.receivedMessageFromWorker",listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void,): this
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).
addListener(event: "Network.requestWillBeSent",listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void,): this
Fired when page is about to send HTTP request.
addListener(event: "Network.responseReceived",listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void,): this
Fired when HTTP response is available.
addListener(event: "Network.loadingFailed",listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void,): this
addListener(event: "Network.loadingFinished",listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void,): this
addListener(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.
addListener(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
connect(): void
Connects a session to the inspector back-end.
connectToMainThread(): void
Connects a session to the inspector back-end. An exception will be thrown if this API was not called on a Worker thread.
disconnect(): void
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.
emit(event: string | symbol,...args: any[],): boolean
emit(event: "inspectorNotification",message: InspectorNotification<object>,): boolean
emit(event: "Runtime.executionContextCreated",): boolean
emit(event: "Runtime.executionContextDestroyed",): boolean
emit(event: "Runtime.executionContextsCleared"): boolean
emit(event: "Runtime.exceptionThrown",): boolean
emit(event: "Runtime.exceptionRevoked",): boolean
emit(event: "Runtime.consoleAPICalled",): boolean
emit(event: "Runtime.inspectRequested",): boolean
emit(event: "Debugger.scriptParsed",): boolean
emit(event: "Debugger.scriptFailedToParse",): boolean
emit(event: "Debugger.breakpointResolved",): boolean
emit(event: "Debugger.paused",): boolean
emit(event: "Debugger.resumed"): boolean
emit(event: "Console.messageAdded",): boolean
emit(event: "Profiler.consoleProfileStarted",): boolean
emit(event: "Profiler.consoleProfileFinished",): boolean
emit(event: "HeapProfiler.addHeapSnapshotChunk",): boolean
emit(event: "HeapProfiler.resetProfiles"): boolean
emit(event: "HeapProfiler.reportHeapSnapshotProgress",): boolean
emit(event: "HeapProfiler.lastSeenObjectId",): boolean
emit(event: "HeapProfiler.heapStatsUpdate",): boolean
emit(event: "NodeTracing.dataCollected",): boolean
emit(event: "NodeTracing.tracingComplete"): boolean
emit(event: "NodeWorker.attachedToWorker",): boolean
emit(event: "NodeWorker.detachedFromWorker",): boolean
emit(event: "NodeWorker.receivedMessageFromWorker",): boolean
emit(event: "Network.requestWillBeSent",): boolean
emit(event: "Network.responseReceived",): boolean
emit(event: "Network.loadingFailed",): boolean
emit(event: "Network.loadingFinished",): boolean
emit(event: "NodeRuntime.waitingForDisconnect"): boolean
emit(event: "NodeRuntime.waitingForDebugger"): boolean
on(event: string,listener: (...args: any[]) => void,): this
on(event: "inspectorNotification",listener: (message: InspectorNotification<object>) => void,): this
Emitted when any notification from the V8 Inspector is received.
on(event: "Runtime.executionContextCreated",listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void,): this
Issued when new execution context is created.
on(event: "Runtime.executionContextDestroyed",listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void,): this
Issued when execution context is destroyed.
on(event: "Runtime.executionContextsCleared",listener: () => void,): this
Issued when all executionContexts were cleared in browser
on(event: "Runtime.exceptionThrown",listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void,): this
Issued when exception was thrown and unhandled.
on(event: "Runtime.exceptionRevoked",listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void,): this
Issued when unhandled exception was revoked.
on(event: "Runtime.consoleAPICalled",listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void,): this
Issued when console API was called.
on(event: "Runtime.inspectRequested",listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void,): this
Issued when object should be inspected (for example, as a result of inspect() command line API call).
on(event: "Debugger.scriptParsed",listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void,): this
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
on(event: "Debugger.scriptFailedToParse",listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void,): this
Fired when virtual machine fails to parse the script.
on(event: "Debugger.breakpointResolved",listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void,): this
Fired when breakpoint is resolved to an actual script and location.
on(event: "Debugger.paused",listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void,): this
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
on(event: "Debugger.resumed",listener: () => void,): this
Fired when the virtual machine resumed execution.
on(event: "Console.messageAdded",listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void,): this
Issued when new console message is added.
on(event: "Profiler.consoleProfileStarted",listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void,): this
Sent when new profile recording is started using console.profile() call.
on(event: "Profiler.consoleProfileFinished",listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void,): this
on(event: "HeapProfiler.addHeapSnapshotChunk",listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void,): this
on(event: "HeapProfiler.resetProfiles",listener: () => void,): this
on(event: "HeapProfiler.reportHeapSnapshotProgress",listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void,): this
on(event: "HeapProfiler.lastSeenObjectId",listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void,): 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.
on(event: "HeapProfiler.heapStatsUpdate",listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void,): this
If heap objects tracking has been started then backend may send update for one or more fragments
on(event: "NodeTracing.dataCollected",listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void,): this
Contains an bucket of collected trace events.
on(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.
on(event: "NodeWorker.attachedToWorker",listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void,): this
Issued when attached to a worker.
on(event: "NodeWorker.detachedFromWorker",listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void,): this
Issued when detached from the worker.
on(event: "NodeWorker.receivedMessageFromWorker",listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void,): this
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).
on(event: "Network.requestWillBeSent",listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void,): this
Fired when page is about to send HTTP request.
on(event: "Network.responseReceived",listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void,): this
Fired when HTTP response is available.
on(event: "Network.loadingFailed",listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void,): this
on(event: "Network.loadingFinished",listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void,): this
on(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.
on(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
once(event: string,listener: (...args: any[]) => void,): this
once(event: "inspectorNotification",listener: (message: InspectorNotification<object>) => void,): this
Emitted when any notification from the V8 Inspector is received.
once(event: "Runtime.executionContextCreated",listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void,): this
Issued when new execution context is created.
once(event: "Runtime.executionContextDestroyed",listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void,): this
Issued when execution context is destroyed.
once(event: "Runtime.executionContextsCleared",listener: () => void,): this
Issued when all executionContexts were cleared in browser
once(event: "Runtime.exceptionThrown",listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void,): this
Issued when exception was thrown and unhandled.
once(event: "Runtime.exceptionRevoked",listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void,): this
Issued when unhandled exception was revoked.
once(event: "Runtime.consoleAPICalled",listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void,): this
Issued when console API was called.
once(event: "Runtime.inspectRequested",listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void,): this
Issued when object should be inspected (for example, as a result of inspect() command line API call).
once(event: "Debugger.scriptParsed",listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void,): this
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
once(event: "Debugger.scriptFailedToParse",listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void,): this
Fired when virtual machine fails to parse the script.
once(event: "Debugger.breakpointResolved",listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void,): this
Fired when breakpoint is resolved to an actual script and location.
once(event: "Debugger.paused",listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void,): this
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
once(event: "Debugger.resumed",listener: () => void,): this
Fired when the virtual machine resumed execution.
once(event: "Console.messageAdded",listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void,): this
Issued when new console message is added.
once(event: "Profiler.consoleProfileStarted",listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void,): this
Sent when new profile recording is started using console.profile() call.
once(event: "Profiler.consoleProfileFinished",listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void,): this
once(event: "HeapProfiler.addHeapSnapshotChunk",listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void,): this
once(event: "HeapProfiler.resetProfiles",listener: () => void,): this
once(event: "HeapProfiler.reportHeapSnapshotProgress",listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void,): this
once(event: "HeapProfiler.lastSeenObjectId",listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void,): 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.
once(event: "HeapProfiler.heapStatsUpdate",listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void,): this
If heap objects tracking has been started then backend may send update for one or more fragments
once(event: "NodeTracing.dataCollected",listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void,): this
Contains an bucket of collected trace events.
once(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.
once(event: "NodeWorker.attachedToWorker",listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void,): this
Issued when attached to a worker.
once(event: "NodeWorker.detachedFromWorker",listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void,): this
Issued when detached from the worker.
once(event: "NodeWorker.receivedMessageFromWorker",listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void,): this
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).
once(event: "Network.requestWillBeSent",listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void,): this
Fired when page is about to send HTTP request.
once(event: "Network.responseReceived",listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void,): this
Fired when HTTP response is available.
once(event: "Network.loadingFailed",listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void,): this
once(event: "Network.loadingFinished",listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void,): this
once(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.
once(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
post(method: string,params?: object,): Promise<void>
Posts a message to the inspector back-end.
import { Session } from 'node:inspector/promises'; try { const session = new Session(); session.connect(); const result = await session.post('Runtime.evaluate', { expression: '2 + 2' }); console.log(result); } catch (error) { console.error(error); } // Output: { result: { 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.
post(method: "Schema.getDomains"): Promise<Schema.GetDomainsReturnType>
Returns supported domains.
post(method: "Runtime.evaluate",params?: Runtime.EvaluateParameterType,): Promise<Runtime.EvaluateReturnType>
Evaluates expression on global object.
post(method: "Runtime.awaitPromise",params?: Runtime.AwaitPromiseParameterType,): Promise<Runtime.AwaitPromiseReturnType>
Add handler to promise with given promise object id.
post(method: "Runtime.callFunctionOn",params?: Runtime.CallFunctionOnParameterType,): Promise<Runtime.CallFunctionOnReturnType>
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
post(method: "Runtime.getProperties",params?: Runtime.GetPropertiesParameterType,): Promise<Runtime.GetPropertiesReturnType>
Returns properties of a given object. Object group of the result is inherited from the target object.
post(method: "Runtime.releaseObject",params?: Runtime.ReleaseObjectParameterType,): Promise<void>
Releases remote object with given id.
post(method: "Runtime.releaseObjectGroup",params?: Runtime.ReleaseObjectGroupParameterType,): Promise<void>
Releases all remote objects that belong to a given group.
post(method: "Runtime.runIfWaitingForDebugger"): Promise<void>
Tells inspected instance to run if it was waiting for debugger to attach.
post(method: "Runtime.enable"): Promise<void>
Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
post(method: "Runtime.disable"): Promise<void>
Disables reporting of execution contexts creation.
post(method: "Runtime.discardConsoleEntries"): Promise<void>
Discards collected exceptions and console API calls.
post(method: "Runtime.setCustomObjectFormatterEnabled",): Promise<void>
post(method: "Runtime.compileScript",params?: Runtime.CompileScriptParameterType,): Promise<Runtime.CompileScriptReturnType>
Compiles expression.
post(method: "Runtime.runScript",params?: Runtime.RunScriptParameterType,): Promise<Runtime.RunScriptReturnType>
Runs script with given id in a given context.
post(method: "Runtime.queryObjects",params?: Runtime.QueryObjectsParameterType,): Promise<Runtime.QueryObjectsReturnType>
post(method: "Runtime.globalLexicalScopeNames",): Promise<Runtime.GlobalLexicalScopeNamesReturnType>
Returns all let, const and class variables from global scope.
post(method: "Debugger.enable"): Promise<Debugger.EnableReturnType>
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
post(method: "Debugger.disable"): Promise<void>
Disables debugger for given page.
post(method: "Debugger.setBreakpointsActive",): Promise<void>
Activates / deactivates all breakpoints on the page.
post(method: "Debugger.setSkipAllPauses",params?: Debugger.SetSkipAllPausesParameterType,): Promise<void>
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
post(method: "Debugger.setBreakpointByUrl",params?: Debugger.SetBreakpointByUrlParameterType,): Promise<Debugger.SetBreakpointByUrlReturnType>
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 <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads.
post(method: "Debugger.setBreakpoint",params?: Debugger.SetBreakpointParameterType,): Promise<Debugger.SetBreakpointReturnType>
Sets JavaScript breakpoint at a given location.
post(method: "Debugger.removeBreakpoint",params?: Debugger.RemoveBreakpointParameterType,): Promise<void>
Removes JavaScript breakpoint.
post(method: "Debugger.getPossibleBreakpoints",): Promise<Debugger.GetPossibleBreakpointsReturnType>
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
post(method: "Debugger.continueToLocation",params?: Debugger.ContinueToLocationParameterType,): Promise<void>
Continues execution until specific location is reached.
post(method: "Debugger.pauseOnAsyncCall",params?: Debugger.PauseOnAsyncCallParameterType,): Promise<void>
post(method: "Debugger.stepOver"): Promise<void>
Steps over the statement.
post(method: "Debugger.stepInto",params?: Debugger.StepIntoParameterType,): Promise<void>
Steps into the function call.
post(method: "Debugger.stepOut"): Promise<void>
Steps out of the function call.
post(method: "Debugger.pause"): Promise<void>
Stops on the next JavaScript statement.
post(method: "Debugger.scheduleStepIntoAsync"): Promise<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.
post(method: "Debugger.resume"): Promise<void>
Resumes JavaScript execution.
post(method: "Debugger.getStackTrace",params?: Debugger.GetStackTraceParameterType,): Promise<Debugger.GetStackTraceReturnType>
Returns stack trace with given <code>stackTraceId</code>.
post(method: "Debugger.searchInContent",params?: Debugger.SearchInContentParameterType,): Promise<Debugger.SearchInContentReturnType>
Searches for given string in script content.
post(method: "Debugger.setScriptSource",params?: Debugger.SetScriptSourceParameterType,): Promise<Debugger.SetScriptSourceReturnType>
Edits JavaScript source live.
post(method: "Debugger.restartFrame",params?: Debugger.RestartFrameParameterType,): Promise<Debugger.RestartFrameReturnType>
Restarts particular call frame from the beginning.
post(method: "Debugger.getScriptSource",params?: Debugger.GetScriptSourceParameterType,): Promise<Debugger.GetScriptSourceReturnType>
Returns source for the script with given id.
post(method: "Debugger.setPauseOnExceptions",): Promise<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 <code>none</code>.
post(method: "Debugger.evaluateOnCallFrame",): Promise<Debugger.EvaluateOnCallFrameReturnType>
Evaluates expression on a given call frame.
post(method: "Debugger.setVariableValue",params?: Debugger.SetVariableValueParameterType,): Promise<void>
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
post(method: "Debugger.setReturnValue",params?: Debugger.SetReturnValueParameterType,): Promise<void>
Changes return value in top frame. Available only at return break position.
post(method: "Debugger.setAsyncCallStackDepth",): Promise<void>
Enables or disables async call stacks tracking.
post(method: "Debugger.setBlackboxPatterns",): Promise<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.
post(method: "Debugger.setBlackboxedRanges",): Promise<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.
post(method: "Console.enable"): Promise<void>
Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
post(method: "Console.disable"): Promise<void>
Disables console domain, prevents further console messages from being reported to the client.
post(method: "Console.clearMessages"): Promise<void>
Does nothing.
post(method: "Profiler.enable"): Promise<void>
post(method: "Profiler.disable"): Promise<void>
post(method: "Profiler.setSamplingInterval",): Promise<void>
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
post(method: "Profiler.start"): Promise<void>
post(method: "Profiler.stop"): Promise<Profiler.StopReturnType>
post(method: "Profiler.startPreciseCoverage",): Promise<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.
post(method: "Profiler.stopPreciseCoverage"): Promise<void>
Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
post(method: "Profiler.takePreciseCoverage"): Promise<Profiler.TakePreciseCoverageReturnType>
Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
post(method: "Profiler.getBestEffortCoverage"): Promise<Profiler.GetBestEffortCoverageReturnType>
Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
post(method: "HeapProfiler.enable"): Promise<void>
post(method: "HeapProfiler.disable"): Promise<void>
post(method: "HeapProfiler.startTrackingHeapObjects",): Promise<void>
post(method: "HeapProfiler.stopTrackingHeapObjects",): Promise<void>
post(method: "HeapProfiler.takeHeapSnapshot",): Promise<void>
post(method: "HeapProfiler.collectGarbage"): Promise<void>
post(method: "HeapProfiler.getObjectByHeapObjectId",): Promise<HeapProfiler.GetObjectByHeapObjectIdReturnType>
post(method: "HeapProfiler.addInspectedHeapObject",): Promise<void>
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
post(method: "HeapProfiler.getHeapObjectId",): Promise<HeapProfiler.GetHeapObjectIdReturnType>
post(method: "HeapProfiler.startSampling",params?: HeapProfiler.StartSamplingParameterType,): Promise<void>
post(method: "HeapProfiler.stopSampling"): Promise<HeapProfiler.StopSamplingReturnType>
post(method: "HeapProfiler.getSamplingProfile"): Promise<HeapProfiler.GetSamplingProfileReturnType>
post(method: "NodeTracing.getCategories"): Promise<NodeTracing.GetCategoriesReturnType>
Gets supported tracing categories.
post(method: "NodeTracing.start",params?: NodeTracing.StartParameterType,): Promise<void>
Start trace events collection.
post(method: "NodeTracing.stop"): Promise<void>
Stop trace events collection. Remaining collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.
post(method: "NodeWorker.sendMessageToWorker",): Promise<void>
Sends protocol message over session with given id.
post(method: "NodeWorker.enable",params?: NodeWorker.EnableParameterType,): Promise<void>
Instructs the inspector to attach to running workers. Will also attach to new workers as they start
post(method: "NodeWorker.disable"): Promise<void>
Detaches from all running workers and disables attaching to new workers as they are started.
post(method: "NodeWorker.detach",params?: NodeWorker.DetachParameterType,): Promise<void>
Detached from the worker with given sessionId.
post(method: "Network.disable"): Promise<void>
Disables network tracking, prevents network events from being sent to the client.
post(method: "Network.enable"): Promise<void>
Enables network tracking, network events will now be delivered to the client.
post(method: "NodeRuntime.enable"): Promise<void>
Enable the NodeRuntime events except by NodeRuntime.waitingForDisconnect
.
post(method: "NodeRuntime.disable"): Promise<void>
Disable NodeRuntime events
post(method: "NodeRuntime.notifyWhenWaitingForDisconnect",): Promise<void>
Enable the NodeRuntime.waitingForDisconnect
.
prependListener(event: string,listener: (...args: any[]) => void,): this
prependListener(event: "inspectorNotification",listener: (message: InspectorNotification<object>) => void,): this
Emitted when any notification from the V8 Inspector is received.
prependListener(event: "Runtime.executionContextCreated",listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void,): this
Issued when new execution context is created.
prependListener(event: "Runtime.executionContextDestroyed",listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void,): this
Issued when execution context is destroyed.
prependListener(event: "Runtime.executionContextsCleared",listener: () => void,): this
Issued when all executionContexts were cleared in browser
prependListener(event: "Runtime.exceptionThrown",listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void,): this
Issued when exception was thrown and unhandled.
prependListener(event: "Runtime.exceptionRevoked",listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void,): this
Issued when unhandled exception was revoked.
prependListener(event: "Runtime.consoleAPICalled",listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void,): this
Issued when console API was called.
prependListener(event: "Runtime.inspectRequested",listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void,): this
Issued when object should be inspected (for example, as a result of inspect() command line API call).
prependListener(event: "Debugger.scriptParsed",listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void,): this
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
prependListener(event: "Debugger.scriptFailedToParse",listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void,): this
Fired when virtual machine fails to parse the script.
prependListener(event: "Debugger.breakpointResolved",listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void,): this
Fired when breakpoint is resolved to an actual script and location.
prependListener(event: "Debugger.paused",listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void,): this
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
prependListener(event: "Debugger.resumed",listener: () => void,): this
Fired when the virtual machine resumed execution.
prependListener(event: "Console.messageAdded",listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void,): this
Issued when new console message is added.
prependListener(event: "Profiler.consoleProfileStarted",listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void,): this
Sent when new profile recording is started using console.profile() call.
prependListener(event: "Profiler.consoleProfileFinished",listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void,): this
prependListener(event: "HeapProfiler.addHeapSnapshotChunk",listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void,): this
prependListener(event: "HeapProfiler.resetProfiles",listener: () => void,): this
prependListener(event: "HeapProfiler.reportHeapSnapshotProgress",listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void,): this
prependListener(event: "HeapProfiler.lastSeenObjectId",listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void,): 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.
prependListener(event: "HeapProfiler.heapStatsUpdate",listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void,): this
If heap objects tracking has been started then backend may send update for one or more fragments
prependListener(event: "NodeTracing.dataCollected",listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void,): this
Contains an bucket of collected trace events.
prependListener(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.
prependListener(event: "NodeWorker.attachedToWorker",listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void,): this
Issued when attached to a worker.
prependListener(event: "NodeWorker.detachedFromWorker",listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void,): this
Issued when detached from the worker.
prependListener(event: "NodeWorker.receivedMessageFromWorker",listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void,): this
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).
prependListener(event: "Network.requestWillBeSent",listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void,): this
Fired when page is about to send HTTP request.
prependListener(event: "Network.responseReceived",listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void,): this
Fired when HTTP response is available.
prependListener(event: "Network.loadingFailed",listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void,): this
prependListener(event: "Network.loadingFinished",listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void,): this
prependListener(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.
prependListener(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
prependOnceListener(event: string,listener: (...args: any[]) => void,): this
prependOnceListener(event: "inspectorNotification",listener: (message: InspectorNotification<object>) => void,): this
Emitted when any notification from the V8 Inspector is received.
prependOnceListener(event: "Runtime.executionContextCreated",listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void,): this
Issued when new execution context is created.
prependOnceListener(event: "Runtime.executionContextDestroyed",listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void,): this
Issued when execution context is destroyed.
prependOnceListener(event: "Runtime.executionContextsCleared",listener: () => void,): this
Issued when all executionContexts were cleared in browser
prependOnceListener(event: "Runtime.exceptionThrown",listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void,): this
Issued when exception was thrown and unhandled.
prependOnceListener(event: "Runtime.exceptionRevoked",listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void,): this
Issued when unhandled exception was revoked.
prependOnceListener(event: "Runtime.consoleAPICalled",listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void,): this
Issued when console API was called.
prependOnceListener(event: "Runtime.inspectRequested",listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void,): this
Issued when object should be inspected (for example, as a result of inspect() command line API call).
prependOnceListener(event: "Debugger.scriptParsed",listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void,): this
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
prependOnceListener(event: "Debugger.scriptFailedToParse",listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void,): this
Fired when virtual machine fails to parse the script.
prependOnceListener(event: "Debugger.breakpointResolved",listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void,): this
Fired when breakpoint is resolved to an actual script and location.
prependOnceListener(event: "Debugger.paused",listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void,): this
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
prependOnceListener(event: "Debugger.resumed",listener: () => void,): this
Fired when the virtual machine resumed execution.
prependOnceListener(event: "Console.messageAdded",listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void,): this
Issued when new console message is added.
prependOnceListener(event: "Profiler.consoleProfileStarted",listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void,): this
Sent when new profile recording is started using console.profile() call.
prependOnceListener(event: "Profiler.consoleProfileFinished",listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void,): this
prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk",listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void,): this
prependOnceListener(event: "HeapProfiler.resetProfiles",listener: () => void,): this
prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress",listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void,): this
prependOnceListener(event: "HeapProfiler.lastSeenObjectId",listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void,): 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.
prependOnceListener(event: "HeapProfiler.heapStatsUpdate",listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void,): this
If heap objects tracking has been started then backend may send update for one or more fragments
prependOnceListener(event: "NodeTracing.dataCollected",listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void,): this
Contains an bucket of collected trace events.
prependOnceListener(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.
prependOnceListener(event: "NodeWorker.attachedToWorker",listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void,): this
Issued when attached to a worker.
prependOnceListener(event: "NodeWorker.detachedFromWorker",listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void,): this
Issued when detached from the worker.
prependOnceListener(event: "NodeWorker.receivedMessageFromWorker",listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void,): this
Notifies about a new protocol message received from the session (session ID is provided in attachedToWorker notification).
prependOnceListener(event: "Network.requestWillBeSent",listener: (message: InspectorNotification<Network.RequestWillBeSentEventDataType>) => void,): this
Fired when page is about to send HTTP request.
prependOnceListener(event: "Network.responseReceived",listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void,): this
Fired when HTTP response is available.
prependOnceListener(event: "Network.loadingFailed",listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void,): this
prependOnceListener(event: "Network.loadingFinished",listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void,): this
prependOnceListener(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.
prependOnceListener(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