Skip to main content
Session.prototype.post - inspector - Node documentation
method Session.prototype.post
Unstable

Usage in Deno

import { Session } from "node:inspector";
Session.prototype.post(
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.

Parameters

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

Return Type

void
Session.prototype.post(
method: string,
params?: object,
callback?: (
err: Error | null,
params?: object,
) => void
,
): void

Parameters

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

Return Type

void
Session.prototype.post(
method: "Schema.getDomains",
callback?: (
err: Error | null,
) => void
,
): void

Returns supported domains.

Parameters

method: "Schema.getDomains"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.evaluate",
callback?: (
err: Error | null,
) => void
,
): void

Evaluates expression on global object.

Parameters

method: "Runtime.evaluate"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.evaluate",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.evaluate"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.awaitPromise",
callback?: (
err: Error | null,
) => void
,
): void

Add handler to promise with given promise object id.

Parameters

method: "Runtime.awaitPromise"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.awaitPromise",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.awaitPromise"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
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.

Parameters

method: "Runtime.callFunctionOn"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.callFunctionOn",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.callFunctionOn"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
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.

Parameters

method: "Runtime.getProperties"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.getProperties",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.getProperties"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.releaseObject",
callback?: (err: Error | null) => void,
): void

Releases remote object with given id.

Parameters

method: "Runtime.releaseObject"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.releaseObject",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Runtime.releaseObject"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.releaseObjectGroup",
callback?: (err: Error | null) => void,
): void

Releases all remote objects that belong to a given group.

Parameters

method: "Runtime.releaseObjectGroup"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.releaseObjectGroup",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Runtime.releaseObjectGroup"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.runIfWaitingForDebugger",
callback?: (err: Error | null) => void,
): void

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

Parameters

method: "Runtime.runIfWaitingForDebugger"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
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.

Parameters

method: "Runtime.enable"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.disable",
callback?: (err: Error | null) => void,
): void

Disables reporting of execution contexts creation.

Parameters

method: "Runtime.disable"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.discardConsoleEntries",
callback?: (err: Error | null) => void,
): void

Discards collected exceptions and console API calls.

Parameters

method: "Runtime.discardConsoleEntries"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.setCustomObjectFormatterEnabled",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Runtime.setCustomObjectFormatterEnabled"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.setCustomObjectFormatterEnabled",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Runtime.setCustomObjectFormatterEnabled"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Runtime.compileScript",
callback?: (
err: Error | null,
) => void
,
): void

Compiles expression.

Parameters

method: "Runtime.compileScript"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.compileScript",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.compileScript"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.runScript",
callback?: (
err: Error | null,
) => void
,
): void

Runs script with given id in a given context.

Parameters

method: "Runtime.runScript"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.runScript",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.runScript"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.queryObjects",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.queryObjects"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.queryObjects",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Runtime.queryObjects"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Runtime.globalLexicalScopeNames",
callback?: () => void,
): void

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

Parameters

method: "Runtime.globalLexicalScopeNames"
optional
callback: () => void

Return Type

void
Session.prototype.post(
method: "Runtime.globalLexicalScopeNames",
callback?: () => void,
): void

Parameters

method: "Runtime.globalLexicalScopeNames"
optional
callback: () => void

Return Type

void
Session.prototype.post(
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.

Parameters

method: "Debugger.enable"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Debugger.disable",
callback?: (err: Error | null) => void,
): void

Disables debugger for given page.

Parameters

method: "Debugger.disable"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setBreakpointsActive",
callback?: (err: Error | null) => void,
): void

Activates / deactivates all breakpoints on the page.

Parameters

method: "Debugger.setBreakpointsActive"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setBreakpointsActive",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.setBreakpointsActive"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setSkipAllPauses",
callback?: (err: Error | null) => void,
): void

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

Parameters

method: "Debugger.setSkipAllPauses"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setSkipAllPauses",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.setSkipAllPauses"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
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.

Parameters

method: "Debugger.setBreakpointByUrl"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setBreakpointByUrl",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Debugger.setBreakpointByUrl"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setBreakpoint",
callback?: (
err: Error | null,
) => void
,
): void

Sets JavaScript breakpoint at a given location.

Parameters

method: "Debugger.setBreakpoint"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Debugger.setBreakpoint",
callback?: (
err: Error | null,
) => void
,
): void

Parameters

method: "Debugger.setBreakpoint"
optional
callback: (
err: Error | null,
) => void

Return Type

void
Session.prototype.post(
method: "Debugger.removeBreakpoint",
callback?: (err: Error | null) => void,
): void

Removes JavaScript breakpoint.

Parameters

method: "Debugger.removeBreakpoint"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.removeBreakpoint",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.removeBreakpoint"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.getPossibleBreakpoints",
callback?: () => void,
): void

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

Parameters

method: "Debugger.getPossibleBreakpoints"
optional
callback: () => void

Return Type

void
Session.prototype.post(
method: "Debugger.getPossibleBreakpoints",
callback?: () => void,
): void

Parameters

method: "Debugger.getPossibleBreakpoints"
optional
callback: () => void

Return Type

void
Session.prototype.post(
method: "Debugger.continueToLocation",
callback?: (err: Error | null) => void,
): void

Continues execution until specific location is reached.

Parameters

method: "Debugger.continueToLocation"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.continueToLocation",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.continueToLocation"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.pauseOnAsyncCall",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.pauseOnAsyncCall"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.pauseOnAsyncCall",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.pauseOnAsyncCall"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.stepOver",
callback?: (err: Error | null) => void,
): void

Steps over the statement.

Parameters

method: "Debugger.stepOver"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.stepInto",
callback?: (err: Error | null) => void,
): void

Steps into the function call.

Parameters

method: "Debugger.stepInto"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.stepInto",
callback?: (err: Error | null) => void,
): void

Parameters

method: "Debugger.stepInto"
optional
callback: (err: Error | null) => void

Return Type

void
Session.prototype.post(
method: "Debugger.stepOut",
callback?: (err: Error | null) => void,
): void

Steps out of the function call.

Parameters