stable (1.2) latest (tip-of-tree) v8-inspector (node) Home Domains Accessibility Animation ApplicationCache CSS CacheStorage Console DOM DOMDebugger DOMStorage Database Debugger DeviceOrientation Emulation HeapProfiler IO IndexedDB Input Inspector LayerTree Log Memory Network Page Profiler Runtime Schema Security ServiceWorker Storage SystemInfo Target Tethering Tracing
Chrome Debugging Protocol Viewer - latest (tip-of-tree)

Debugger Domain

Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.

Methods

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.

Debugger. disable

Disables debugger for given page.

Debugger. setBreakpointsActive

Activates / deactivates all breakpoints on the page.

Parameters
active
boolean New value for breakpoints active state.

Debugger. setSkipAllPauses

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

Parameters
skip
boolean New value for skip pauses state.

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.
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. 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. removeBreakpoint

Removes JavaScript breakpoint.

Parameters
breakpointId
BreakpointId

Debugger. getPossibleBreakpoints

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

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. continueToLocation

Continues execution until specific location is reached.

Parameters
location
Location Location to continue to.

Debugger. stepOver

Steps over the statement.

Debugger. stepInto

Steps into the function call.

Debugger. stepOut

Steps out of the function call.

Debugger. pause

Stops on the next JavaScript statement.

Debugger. scheduleStepIntoAsync

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. Experimental

Debugger. resume

Resumes JavaScript execution.

Debugger. searchInContent

Searches for given string in script content. Experimental

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. setScriptSource

Edits JavaScript source live.

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.
Return object
callFrames
array [ CallFrame ] New stack trace in case editing has happened while VM was stopped.
stackChanged
boolean Whether current call stack was modified after applying the changes.
asyncStackTrace
Runtime.StackTrace Async stack trace, if any.
exceptionDetails
Runtime.ExceptionDetails Exception details if any.

Debugger. restartFrame

Restarts particular call frame from the beginning.

Parameters
callFrameId
CallFrameId Call frame identifier to evaluate on.
Return object
callFrames
array [ CallFrame ] New stack trace.
asyncStackTrace
Runtime.StackTrace Async stack trace, if any.

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.

Debugger. setPauseOnExceptions

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.

Parameters
state
string Pause on exceptions mode. Allowed values: none, uncaught, all.

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. Experimental
Return object
result
Runtime.RemoteObject Object wrapper for the evaluation result.
exceptionDetails
Runtime.ExceptionDetails Exception details.

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. 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. setBlackboxPatterns

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. Experimental

Parameters
patterns
array [string] Array of regexps that will be used to check script url for blackbox state.

Debugger. setBlackboxedRanges

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. Experimental

Parameters
scriptId
Runtime.ScriptId Id of the script.
positions
array [ ScriptPosition ]

Events

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.
executionContextAuxData
object Embedder-specific auxiliary data.
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. Experimental
isModule
boolean True, if this script is ES6 module. Experimental
length
integer This script length. Experimental
stackTrace
Runtime.StackTrace JavaScript top stack frame of where the script parsed event was triggered if available. Experimental

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.
executionContextAuxData
object Embedder-specific auxiliary data.
sourceMapURL
string URL of source map associated with script (if any).
hasSourceURL
boolean True, if this script has sourceURL. Experimental
isModule
boolean True, if this script is ES6 module. Experimental
length
integer This script length. Experimental
stackTrace
Runtime.StackTrace JavaScript top stack frame of where the script parsed event was triggered if available. Experimental

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: XHR, DOM, EventListener, exception, assert, debugCommand, promiseRejection, OOM, other, ambiguous.
data
object Object containing break-specific auxiliary properties.
hitBreakpoints
array [string] Hit breakpoints IDs
asyncStackTrace
Runtime.StackTrace Async stack trace, if any.

Debugger. resumed

Fired when the virtual machine resumed execution.

Types

BreakpointId

Breakpoint identifier.

Type: string

CallFrameId

Call frame identifier.

Type: string

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).

ScriptPosition

Location in the source code. Experimental

Type: object

Properties
lineNumber
integer
columnNumber
integer

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. Experimental
location
Location Location in the source code.
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.

Scope

Scope description.

Type: object

Properties
type
string Scope type. Allowed values: global, local, with, closure, catch, block, script, eval, module.
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

SearchMatch

Search match for resource. Experimental

Type: object

Properties
lineNumber
number Line number in resource content.
lineContent
string Line with match content.

BreakLocation

Experimental

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.