Chrome DevTools Protocol

Methods

Debugger.continueToLocation

Continues execution until specific location is reached.

parameters
location
Location

Location to continue to.

targetCallFrames
string
Allowed Values: any, current

Debugger.disable

Disables debugger for given page.

Debugger.enable

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
maxScriptsCacheSize
number

The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if parameter is omitted.

Experimental
Return Object
debuggerId
Runtime.UniqueDebuggerId

Unique identifier of the debugger.

Experimental

Debugger.evaluateOnCallFrame

Evaluates expression on a given call frame.

parameters
callFrameId
CallFrameId

Call frame identifier to evaluate on.

expression
string

Expression to evaluate.

objectGroup
string

String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup).

includeCommandLineAPI
boolean

Specifies whether command line API should be available to the evaluated expression, defaults to false.

silent
boolean

In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.

returnByValue
boolean

Whether the result is expected to be a JSON object that should be sent by value.

generatePreview
boolean

Whether preview should be generated for the result.

Experimental
throwOnSideEffect
boolean

Whether to throw an exception if side effect cannot be ruled out during evaluation.

timeout
Runtime.TimeDelta

Terminate execution after timing out (number of milliseconds).

Experimental
Return Object
result
Runtime.RemoteObject

Object wrapper for the evaluation result.

exceptionDetails
Runtime.ExceptionDetails

Exception details.

Debugger.getPossibleBreakpoints

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

parameters
start
Location

Start of range to search possible breakpoint locations in.

end
Location

End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.

restrictToFunction
boolean

Only consider locations which are in the same (non-nested) function as start.

Return Object
locations
array[ BreakLocation ]

List of the possible breakpoint locations.

Debugger.getScriptSource

Returns source for the script with given id.

parameters
scriptId
Runtime.ScriptId

Id of the script to get source for.

Return Object
scriptSource
string

Script source (empty in case of Wasm bytecode).

bytecode
string

Wasm bytecode. (Encoded as a base64 string when passed over JSON)

Debugger.pause

Stops on the next JavaScript statement.

Debugger.removeBreakpoint

Removes JavaScript breakpoint.

parameters
breakpointId
BreakpointId

Debugger.restartFrame

Restarts particular call frame from the beginning. The old, deprecated behavior of restartFrame is to stay paused and allow further CDP commands after a restart was scheduled. This can cause problems with restarting, so we now continue execution immediatly after it has been scheduled until we reach the beginning of the restarted frame.

To stay back-wards compatible, restartFrame now expects a mode parameter to be present. If the mode parameter is missing, restartFrame errors out.

The various return values are deprecated and callFrames is always empty. Use the call frames from the Debugger#paused events instead, that fires once V8 pauses at the beginning of the restarted function.

parameters
callFrameId
CallFrameId

Call frame identifier to evaluate on.

mode
string

The mode parameter must be present and set to 'StepInto', otherwise restartFrame will error out.

Allowed Values: StepInto
Experimental
Return Object
callFrames
array[ CallFrame ]

New stack trace.

Deprecated
asyncStackTrace
Runtime.StackTrace

Async stack trace, if any.

Deprecated
asyncStackTraceId
Runtime.StackTraceId

Async stack trace, if any.

Deprecated

Debugger.resume

Resumes JavaScript execution.

parameters
terminateOnResume
boolean

Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.

Debugger.searchInContent

Searches for given string in script content.

parameters
scriptId
Runtime.ScriptId

Id of the script to search in.

query
string

String to search for.

caseSensitive
boolean

If true, search is case sensitive.

isRegex
boolean

If true, treats string parameter as regex.

Return Object
result
array[ SearchMatch ]

List of search matches.

Debugger.setAsyncCallStackDepth

Enables or disables async call stacks tracking.

parameters
maxDepth
integer

Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).

Debugger.setBreakpoint

Sets JavaScript breakpoint at a given location.

parameters
location
Location

Location to set breakpoint in.

condition
string

Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

Return Object
breakpointId
BreakpointId

Id of the created breakpoint for further reference.

actualLocation
Location

Location this breakpoint resolved into.

Debugger.setBreakpointByUrl

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
lineNumber
integer

Line number to set breakpoint at.

url
string

URL of the resources to set breakpoint on.

urlRegex
string

Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified.

scriptHash
string

Script hash of the resources to set breakpoint on.

columnNumber
integer

Offset in the line to set breakpoint at.

condition
string

Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

Return Object
breakpointId
BreakpointId

Id of the created breakpoint for further reference.

locations
array[ Location ]

List of the locations this breakpoint resolved into upon addition.

Debugger.setBreakpointsActive

Activates / deactivates all breakpoints on the page.

parameters
active
boolean

New value for breakpoints active state.

Debugger.setInstrumentationBreakpoint

Sets instrumentation breakpoint.

parameters
instrumentation
string

Instrumentation name.

Allowed Values: beforeScriptExecution, beforeScriptWithSourceMapExecution
Return Object
breakpointId
BreakpointId

Id of the created breakpoint for further reference.

Debugger.setPauseOnExceptions

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

parameters
state
string

Pause on exceptions mode.

Allowed Values: none, caught, uncaught, all

Debugger.setScriptSource

Edits JavaScript source live.

In general, functions that are currently on the stack can not be edited with a single exception: If the edited function is the top-most stack frame and that is the only activation of that function on the stack. In this case the live edit will be successful and a Debugger.restartFrame for the top-most function is automatically triggered.

parameters
scriptId
Runtime.ScriptId

Id of the script to edit.

scriptSource
string

New content of the script.

dryRun
boolean

If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.

allowTopFrameEditing
boolean

If true, then scriptSource is allowed to change the function on top of the stack as long as the top-most stack frame is the only activation of that function.

Experimental
Return Object
callFrames
array[ CallFrame ]

New stack trace in case editing has happened while VM was stopped.

Deprecated
stackChanged
boolean

Whether current call stack was modified after applying the changes.

Deprecated
asyncStackTrace
Runtime.StackTrace

Async stack trace, if any.

Deprecated
asyncStackTraceId
Runtime.StackTraceId

Async stack trace, if any.

Deprecated
status
string

Whether the operation was successful or not. Only Ok denotes a successful live edit while the other enum variants denote why the live edit failed.

Allowed Values: Ok, CompileError, BlockedByActiveGenerator, BlockedByActiveFunction, BlockedByTopLevelEsModuleChange
Experimental
exceptionDetails
Runtime.ExceptionDetails

Exception details if any. Only present when status is CompileError.

Debugger.setSkipAllPauses

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

parameters
skip
boolean

New value for skip pauses state.

Debugger.setVariableValue

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

parameters
scopeNumber
integer

0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.

variableName
string

Variable name.

newValue
Runtime.CallArgument

New variable value.

callFrameId
CallFrameId

Id of callframe that holds variable.

Debugger.stepInto

Steps into the function call.

parameters
breakOnAsyncCall
boolean

Debugger will pause on the execution of the first async task which was scheduled before next pause.

Experimental
skipList
array[ LocationRange ]

The skipList specifies location ranges that should be skipped on step into.

Experimental

Debugger.stepOut

Steps out of the function call.

Debugger.stepOver

Steps over the statement.

parameters
skipList
array[ LocationRange ]

The skipList specifies location ranges that should be skipped on step over.

Experimental

Events

Debugger.breakpointResolved

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

parameters
breakpointId
BreakpointId

Breakpoint unique identifier.

location
Location

Actual breakpoint location.

Debugger.paused

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

parameters
callFrames
array[ CallFrame ]

Call stack the virtual machine stopped on.

reason
string

Pause reason.

Allowed Values: ambiguous, assert, CSPViolation, debugCommand, DOM, EventListener, exception, instrumentation, OOM, other, promiseRejection, XHR, step
data
object

Object containing break-specific auxiliary properties.

hitBreakpoints
array[ string ]

Hit breakpoints IDs

asyncStackTrace
Runtime.StackTrace

Async stack trace, if any.

asyncStackTraceId
Runtime.StackTraceId

Async stack trace, if any.

Experimental
asyncCallStackTraceId
Runtime.StackTraceId

Never present, will be removed.

ExperimentalDeprecated

Debugger.resumed

Fired when the virtual machine resumed execution.

Debugger.scriptFailedToParse

Fired when virtual machine fails to parse the script.

parameters
scriptId
Runtime.ScriptId

Identifier of the script parsed.

url
string

URL or name of the script parsed (if any).

startLine
integer

Line offset of the script within the resource with given URL (for script tags).

startColumn
integer

Column offset of the script within the resource with given URL.

endLine
integer

Last line of the script.

endColumn
integer

Length of the last line of the script.

executionContextId
Runtime.ExecutionContextId

Specifies script creation context.

hash
string

Content hash of the script, SHA-256.

executionContextAuxData
object

Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}

sourceMapURL
string

URL of source map associated with script (if any).

hasSourceURL
boolean

True, if this script has sourceURL.

isModule
boolean

True, if this script is ES6 module.

length
integer

This script length.

stackTrace
Runtime.StackTrace

JavaScript top stack frame of where the script parsed event was triggered if available.

Experimental
codeOffset
integer

If the scriptLanguage is WebAssembly, the code section offset in the module.

Experimental
scriptLanguage
Debugger.ScriptLanguage

The language of the script.

Experimental
embedderName
string

The name the embedder supplied for this script.

Experimental

Debugger.scriptParsed

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

parameters
scriptId
Runtime.ScriptId

Identifier of the script parsed.

url
string

URL or name of the script parsed (if any).

startLine
integer

Line offset of the script within the resource with given URL (for script tags).

startColumn
integer

Column offset of the script within the resource with given URL.

endLine
integer

Last line of the script.

endColumn
integer

Length of the last line of the script.

executionContextId
Runtime.ExecutionContextId

Specifies script creation context.

hash
string

Content hash of the script, SHA-256.

executionContextAuxData
object

Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}

isLiveEdit
boolean

True, if this script is generated as a result of the live edit operation.

Experimental
sourceMapURL
string

URL of source map associated with script (if any).

hasSourceURL
boolean

True, if this script has sourceURL.

isModule
boolean

True, if this script is ES6 module.

length
integer

This script length.

stackTrace
Runtime.StackTrace

JavaScript top stack frame of where the script parsed event was triggered if available.

Experimental
codeOffset
integer

If the scriptLanguage is WebAssembly, the code section offset in the module.

Experimental
scriptLanguage
Debugger.ScriptLanguage

The language of the script.

Experimental
debugSymbols
array[ Debugger.DebugSymbols ]

If the scriptLanguage is WebAssembly, the source of debug symbols for the module.

Experimental
embedderName
string

The name the embedder supplied for this script.

Experimental

Types

Debugger.BreakLocation

Type: object

properties
scriptId
Runtime.ScriptId

Script identifier as reported in the Debugger.scriptParsed.

lineNumber
integer

Line number in the script (0-based).

columnNumber
integer

Column number in the script (0-based).

type
string
Allowed Values: debuggerStatement, call, return

Debugger.BreakpointId

Breakpoint identifier.

Type: string

Debugger.CallFrame

JavaScript call frame. Array of call frames form the call stack.

Type: object

properties
callFrameId
CallFrameId

Call frame identifier. This identifier is only valid while the virtual machine is paused.

functionName
string

Name of the JavaScript function called on this call frame.

functionLocation
Location

Location in the source code.

location
Location

Location in the source code.

url
string

JavaScript script name or url. Deprecated in favor of using the location.scriptId to resolve the URL via a previously sent Debugger.scriptParsed event.

Deprecated
scopeChain
array[ Scope ]

Scope chain for this call frame.

this
Runtime.RemoteObject

this object for this call frame.

returnValue
Runtime.RemoteObject

The value being returned, if the function is at return point.

canBeRestarted
boolean

Valid only while the VM is paused and indicates whether this frame can be restarted or not. Note that a true value here does not guarantee that Debugger#restartFrame with this CallFrameId will be successful, but it is very likely.

Experimental

Debugger.CallFrameId

Call frame identifier.

Type: string

Debugger.DebugSymbols

Debug symbols available for a wasm script.

Type: object

properties
type
string

Type of the debug symbols.

Allowed Values: SourceMap, EmbeddedDWARF, ExternalDWARF
externalURL
string

URL of the external symbol source.

Debugger.Location

Location in the source code.

Type: object

properties
scriptId
Runtime.ScriptId

Script identifier as reported in the Debugger.scriptParsed.

lineNumber
integer

Line number in the script (0-based).

columnNumber
integer

Column number in the script (0-based).

Debugger.Scope

Scope description.

Type: object

properties
type
string

Scope type.

Allowed Values: global, local, with, closure, catch, block, script, eval, module, wasm-expression-stack
object
Runtime.RemoteObject

Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.

name
string
startLocation
Location

Location in the source code where scope starts

endLocation
Location

Location in the source code where scope ends

Debugger.ScriptLanguage

Enum of possible script languages.

Allowed Values: JavaScript, WebAssembly

Type: string

Debugger.SearchMatch

Search match for resource.

Type: object

properties
lineNumber
number

Line number in resource content.

lineContent
string

Line with match content.