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.
void
Session.prototype.post(method: string,params?: object,callback?: (err: Error | null,params?: object,) => void,): void
Session.prototype.post(method: "Schema.getDomains",callback?: (err: Error | null,params: Schema.GetDomainsReturnType,) => void,): void
Returns supported domains.
callback: (err: Error | null,params: Schema.GetDomainsReturnType,) => void
void
Session.prototype.post(method: "Runtime.evaluate",params?: Runtime.EvaluateParameterType,callback?: (err: Error | null,params: Runtime.EvaluateReturnType,) => void,): void
Evaluates expression on global object.
params: Runtime.EvaluateParameterType
callback: (err: Error | null,params: Runtime.EvaluateReturnType,) => void
void
Session.prototype.post(method: "Runtime.evaluate",callback?: (err: Error | null,params: Runtime.EvaluateReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.EvaluateReturnType,) => void
void
Session.prototype.post(method: "Runtime.awaitPromise",params?: Runtime.AwaitPromiseParameterType,callback?: (err: Error | null,params: Runtime.AwaitPromiseReturnType,) => void,): void
Add handler to promise with given promise object id.
params: Runtime.AwaitPromiseParameterType
callback: (err: Error | null,params: Runtime.AwaitPromiseReturnType,) => void
void
Session.prototype.post(method: "Runtime.awaitPromise",callback?: (err: Error | null,params: Runtime.AwaitPromiseReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.AwaitPromiseReturnType,) => void
void
Session.prototype.post(method: "Runtime.callFunctionOn",params?: Runtime.CallFunctionOnParameterType,callback?: (err: Error | null,params: Runtime.CallFunctionOnReturnType,) => void,): void
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
params: Runtime.CallFunctionOnParameterType
callback: (err: Error | null,params: Runtime.CallFunctionOnReturnType,) => void
void
Session.prototype.post(method: "Runtime.callFunctionOn",callback?: (err: Error | null,params: Runtime.CallFunctionOnReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.CallFunctionOnReturnType,) => void
void
Session.prototype.post(method: "Runtime.getProperties",params?: Runtime.GetPropertiesParameterType,callback?: (err: Error | null,params: Runtime.GetPropertiesReturnType,) => void,): void
Returns properties of a given object. Object group of the result is inherited from the target object.
params: Runtime.GetPropertiesParameterType
callback: (err: Error | null,params: Runtime.GetPropertiesReturnType,) => void
void
Session.prototype.post(method: "Runtime.getProperties",callback?: (err: Error | null,params: Runtime.GetPropertiesReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.GetPropertiesReturnType,) => void
void
Session.prototype.post(method: "Runtime.releaseObject",params?: Runtime.ReleaseObjectParameterType,callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.releaseObject",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.releaseObjectGroup",params?: Runtime.ReleaseObjectGroupParameterType,callback?: (err: Error | null) => void,): void
Releases all remote objects that belong to a given group.
params: Runtime.ReleaseObjectGroupParameterType
void
Session.prototype.post(method: "Runtime.releaseObjectGroup",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.runIfWaitingForDebugger",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.discardConsoleEntries",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.setCustomObjectFormatterEnabled",callback?: (err: Error | null) => void,): void
params: Runtime.SetCustomObjectFormatterEnabledParameterType
void
Session.prototype.post(method: "Runtime.setCustomObjectFormatterEnabled",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Runtime.compileScript",params?: Runtime.CompileScriptParameterType,callback?: (err: Error | null,params: Runtime.CompileScriptReturnType,) => void,): void
Compiles expression.
params: Runtime.CompileScriptParameterType
callback: (err: Error | null,params: Runtime.CompileScriptReturnType,) => void
void
Session.prototype.post(method: "Runtime.compileScript",callback?: (err: Error | null,params: Runtime.CompileScriptReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.CompileScriptReturnType,) => void
void
Session.prototype.post(method: "Runtime.runScript",params?: Runtime.RunScriptParameterType,callback?: (err: Error | null,params: Runtime.RunScriptReturnType,) => void,): void
Runs script with given id in a given context.
params: Runtime.RunScriptParameterType
callback: (err: Error | null,params: Runtime.RunScriptReturnType,) => void
void
Session.prototype.post(method: "Runtime.runScript",callback?: (err: Error | null,params: Runtime.RunScriptReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.RunScriptReturnType,) => void
void
Session.prototype.post(method: "Runtime.queryObjects",params?: Runtime.QueryObjectsParameterType,callback?: (err: Error | null,params: Runtime.QueryObjectsReturnType,) => void,): void
params: Runtime.QueryObjectsParameterType
callback: (err: Error | null,params: Runtime.QueryObjectsReturnType,) => void
void
Session.prototype.post(method: "Runtime.queryObjects",callback?: (err: Error | null,params: Runtime.QueryObjectsReturnType,) => void,): void
callback: (err: Error | null,params: Runtime.QueryObjectsReturnType,) => void
void
Session.prototype.post(method: "Runtime.globalLexicalScopeNames",callback?: (err: Error | null,) => void,): void
Returns all let, const and class variables from global scope.
params: Runtime.GlobalLexicalScopeNamesParameterType
void
Session.prototype.post(method: "Runtime.globalLexicalScopeNames",callback?: (err: Error | null,) => void,): void
Session.prototype.post(method: "Debugger.enable",callback?: (err: Error | null,params: Debugger.EnableReturnType,) => 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.
callback: (err: Error | null,params: Debugger.EnableReturnType,) => void
void
Session.prototype.post(method: "Debugger.setBreakpointsActive",callback?: (err: Error | null) => void,): void
Activates / deactivates all breakpoints on the page.
params: Debugger.SetBreakpointsActiveParameterType
void
Session.prototype.post(method: "Debugger.setBreakpointsActive",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.setSkipAllPauses",params?: Debugger.SetSkipAllPausesParameterType,callback?: (err: Error | null) => void,): void
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
params: Debugger.SetSkipAllPausesParameterType
void
Session.prototype.post(method: "Debugger.setSkipAllPauses",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.setBreakpointByUrl",params?: Debugger.SetBreakpointByUrlParameterType,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.
params: Debugger.SetBreakpointByUrlParameterType
void
Session.prototype.post(method: "Debugger.setBreakpointByUrl",callback?: (err: Error | null,) => void,): void
Session.prototype.post(method: "Debugger.setBreakpoint",params?: Debugger.SetBreakpointParameterType,callback?: (err: Error | null,params: Debugger.SetBreakpointReturnType,) => void,): void
Sets JavaScript breakpoint at a given location.
params: Debugger.SetBreakpointParameterType
callback: (err: Error | null,params: Debugger.SetBreakpointReturnType,) => void
void
Session.prototype.post(method: "Debugger.setBreakpoint",callback?: (err: Error | null,params: Debugger.SetBreakpointReturnType,) => void,): void
callback: (err: Error | null,params: Debugger.SetBreakpointReturnType,) => void
void
Session.prototype.post(method: "Debugger.removeBreakpoint",params?: Debugger.RemoveBreakpointParameterType,callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.removeBreakpoint",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.getPossibleBreakpoints",callback?: (err: Error | null,) => void,): void
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
params: Debugger.GetPossibleBreakpointsParameterType
void
Session.prototype.post(method: "Debugger.getPossibleBreakpoints",callback?: (err: Error | null,) => void,): void
Session.prototype.post(method: "Debugger.continueToLocation",params?: Debugger.ContinueToLocationParameterType,callback?: (err: Error | null) => void,): void
Continues execution until specific location is reached.
params: Debugger.ContinueToLocationParameterType
void
Session.prototype.post(method: "Debugger.continueToLocation",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.pauseOnAsyncCall",params?: Debugger.PauseOnAsyncCallParameterType,callback?: (err: Error | null) => void,): void
params: Debugger.PauseOnAsyncCallParameterType
void
Session.prototype.post(method: "Debugger.pauseOnAsyncCall",callback?: (err: Error | null) => void,): void
Session.prototype.post(method: "Debugger.stepInto",params?: Debugger.StepIntoParameterType,callback?: (err: Error | null) => void,): void