clj-chrome-devtools.commands.debugger

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

continue-to-location

(continue-to-location)(continue-to-location {:as params, :keys [location target-call-frames]})(continue-to-location connection {:as params, :keys [location target-call-frames]})

Continues execution until specific location is reached.

Parameters map keys:

Key Description
:location Location to continue to.
:target-call-frames null (optional)

disable

(disable)(disable {:as params, :keys []})(disable connection {:as params, :keys []})

Disables debugger for given page.

enable

(enable)(enable {:as params, :keys [max-scripts-cache-size]})(enable connection {:as params, :keys [max-scripts-cache-size]})

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 map keys:

Key Description
:max-scripts-cache-size 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. (optional)

Return map keys:

Key Description
:debugger-id Unique identifier of the debugger.

evaluate-on-call-frame

(evaluate-on-call-frame)(evaluate-on-call-frame {:as params, :keys [call-frame-id expression object-group include-command-line-api silent return-by-value generate-preview throw-on-side-effect timeout]})(evaluate-on-call-frame connection {:as params, :keys [call-frame-id expression object-group include-command-line-api silent return-by-value generate-preview throw-on-side-effect timeout]})

Evaluates expression on a given call frame.

Parameters map keys:

Key Description
:call-frame-id Call frame identifier to evaluate on.
:expression Expression to evaluate.
:object-group String object group name to put result into (allows rapid releasing resulting object handles

using releaseObjectGroup). (optional) :include-command-line-api | Specifies whether command line API should be available to the evaluated expression, defaults to false. (optional) :silent | In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. (optional) :return-by-value | Whether the result is expected to be a JSON object that should be sent by value. (optional) :generate-preview | Whether preview should be generated for the result. (optional) :throw-on-side-effect | Whether to throw an exception if side effect cannot be ruled out during evaluation. (optional) :timeout | Terminate execution after timing out (number of milliseconds). (optional)

Return map keys:

Key Description
:result Object wrapper for the evaluation result.
:exception-details Exception details. (optional)

get-possible-breakpoints

(get-possible-breakpoints)(get-possible-breakpoints {:as params, :keys [start end restrict-to-function]})(get-possible-breakpoints connection {:as params, :keys [start end restrict-to-function]})

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

Parameters map keys:

Key Description
:start Start of range to search possible breakpoint locations in.
:end End of range to search possible breakpoint locations in (excluding). When not specified, end

of scripts is used as end of range. (optional) :restrict-to-function | Only consider locations which are in the same (non-nested) function as start. (optional)

Return map keys:

Key Description
:locations List of the possible breakpoint locations.

get-script-source

(get-script-source)(get-script-source {:as params, :keys [script-id]})(get-script-source connection {:as params, :keys [script-id]})

Returns source for the script with given id.

Parameters map keys:

Key Description
:script-id Id of the script to get source for.

Return map keys:

Key Description
:script-source Script source (empty in case of Wasm bytecode).
:bytecode Wasm bytecode. (Encoded as a base64 string when passed over JSON) (optional)

get-stack-trace

(get-stack-trace)(get-stack-trace {:as params, :keys [stack-trace-id]})(get-stack-trace connection {:as params, :keys [stack-trace-id]})

Returns stack trace with given stackTraceId.

Parameters map keys:

Key Description
:stack-trace-id null

Return map keys:

Key Description
:stack-trace null

get-wasm-bytecode

(get-wasm-bytecode)(get-wasm-bytecode {:as params, :keys [script-id]})(get-wasm-bytecode connection {:as params, :keys [script-id]})

This command is deprecated. Use getScriptSource instead.

Parameters map keys:

Key Description
:script-id Id of the Wasm script to get source for.

Return map keys:

Key Description
:bytecode Script source. (Encoded as a base64 string when passed over JSON)

pause

(pause)(pause {:as params, :keys []})(pause connection {:as params, :keys []})

Stops on the next JavaScript statement.

pause-on-async-call

(pause-on-async-call)(pause-on-async-call {:as params, :keys [parent-stack-trace-id]})(pause-on-async-call connection {:as params, :keys [parent-stack-trace-id]})

Parameters map keys:

Key Description
:parent-stack-trace-id Debugger will pause when async call with given stack trace is started.

remove-breakpoint

(remove-breakpoint)(remove-breakpoint {:as params, :keys [breakpoint-id]})(remove-breakpoint connection {:as params, :keys [breakpoint-id]})

Removes JavaScript breakpoint.

Parameters map keys:

Key Description
:breakpoint-id null

restart-frame

(restart-frame)(restart-frame {:as params, :keys [call-frame-id]})(restart-frame connection {:as params, :keys [call-frame-id]})

Restarts particular call frame from the beginning.

Parameters map keys:

Key Description
:call-frame-id Call frame identifier to evaluate on.

Return map keys:

Key Description
:call-frames New stack trace.
:async-stack-trace Async stack trace, if any. (optional)
:async-stack-trace-id Async stack trace, if any. (optional)

resume

(resume)(resume {:as params, :keys [terminate-on-resume]})(resume connection {:as params, :keys [terminate-on-resume]})

Resumes JavaScript execution.

Parameters map keys:

Key Description
:terminate-on-resume 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. (optional)

search-in-content

(search-in-content)(search-in-content {:as params, :keys [script-id query case-sensitive is-regex]})(search-in-content connection {:as params, :keys [script-id query case-sensitive is-regex]})

Searches for given string in script content.

Parameters map keys:

Key Description
:script-id Id of the script to search in.
:query String to search for.
:case-sensitive If true, search is case sensitive. (optional)
:is-regex If true, treats string parameter as regex. (optional)

Return map keys:

Key Description
:result List of search matches.

set-async-call-stack-depth

(set-async-call-stack-depth)(set-async-call-stack-depth {:as params, :keys [max-depth]})(set-async-call-stack-depth connection {:as params, :keys [max-depth]})

Enables or disables async call stacks tracking.

Parameters map keys:

Key Description
:max-depth Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async

call stacks (default).

set-blackbox-patterns

(set-blackbox-patterns)(set-blackbox-patterns {:as params, :keys [patterns]})(set-blackbox-patterns connection {:as params, :keys [patterns]})

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.

Parameters map keys:

Key Description
:patterns Array of regexps that will be used to check script url for blackbox state.

set-blackboxed-ranges

(set-blackboxed-ranges)(set-blackboxed-ranges {:as params, :keys [script-id positions]})(set-blackboxed-ranges connection {:as params, :keys [script-id positions]})

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.

Parameters map keys:

Key Description
:script-id Id of the script.
:positions null

set-breakpoint

(set-breakpoint)(set-breakpoint {:as params, :keys [location condition]})(set-breakpoint connection {:as params, :keys [location condition]})

Sets JavaScript breakpoint at a given location.

Parameters map keys:

Key Description
:location Location to set breakpoint in.
:condition Expression to use as a breakpoint condition. When specified, debugger will only stop on the

breakpoint if this expression evaluates to true. (optional)

Return map keys:

Key Description
:breakpoint-id Id of the created breakpoint for further reference.
:actual-location Location this breakpoint resolved into.

set-breakpoint-by-url

(set-breakpoint-by-url)(set-breakpoint-by-url {:as params, :keys [line-number url url-regex script-hash column-number condition]})(set-breakpoint-by-url connection {:as params, :keys [line-number url url-regex script-hash column-number condition]})

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 map keys:

Key Description
:line-number Line number to set breakpoint at.
:url URL of the resources to set breakpoint on. (optional)
:url-regex Regex pattern for the URLs of the resources to set breakpoints on. Either url or

urlRegex must be specified. (optional) :script-hash | Script hash of the resources to set breakpoint on. (optional) :column-number | Offset in the line to set breakpoint at. (optional) :condition | Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. (optional)

Return map keys:

Key Description
:breakpoint-id Id of the created breakpoint for further reference.
:locations List of the locations this breakpoint resolved into upon addition.

set-breakpoint-on-function-call

(set-breakpoint-on-function-call)(set-breakpoint-on-function-call {:as params, :keys [object-id condition]})(set-breakpoint-on-function-call connection {:as params, :keys [object-id condition]})

Sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint.

Parameters map keys:

Key Description
:object-id Function object id.
:condition Expression to use as a breakpoint condition. When specified, debugger will

stop on the breakpoint if this expression evaluates to true. (optional)

Return map keys:

Key Description
:breakpoint-id Id of the created breakpoint for further reference.

set-breakpoints-active

(set-breakpoints-active)(set-breakpoints-active {:as params, :keys [active]})(set-breakpoints-active connection {:as params, :keys [active]})

Activates / deactivates all breakpoints on the page.

Parameters map keys:

Key Description
:active New value for breakpoints active state.

set-instrumentation-breakpoint

(set-instrumentation-breakpoint)(set-instrumentation-breakpoint {:as params, :keys [instrumentation]})(set-instrumentation-breakpoint connection {:as params, :keys [instrumentation]})

Sets instrumentation breakpoint.

Parameters map keys:

Key Description
:instrumentation Instrumentation name.

Return map keys:

Key Description
:breakpoint-id Id of the created breakpoint for further reference.

set-pause-on-exceptions

(set-pause-on-exceptions)(set-pause-on-exceptions {:as params, :keys [state]})(set-pause-on-exceptions connection {:as params, :keys [state]})

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 map keys:

Key Description
:state Pause on exceptions mode.

set-return-value

(set-return-value)(set-return-value {:as params, :keys [new-value]})(set-return-value connection {:as params, :keys [new-value]})

Changes return value in top frame. Available only at return break position.

Parameters map keys:

Key Description
:new-value New return value.

set-script-source

(set-script-source)(set-script-source {:as params, :keys [script-id script-source dry-run]})(set-script-source connection {:as params, :keys [script-id script-source dry-run]})

Edits JavaScript source live.

Parameters map keys:

Key Description
:script-id Id of the script to edit.
:script-source New content of the script.
:dry-run If true the change will not actually be applied. Dry run may be used to get result

description without actually modifying the code. (optional)

Return map keys:

Key Description
:call-frames New stack trace in case editing has happened while VM was stopped. (optional)
:stack-changed Whether current call stack was modified after applying the changes. (optional)
:async-stack-trace Async stack trace, if any. (optional)
:async-stack-trace-id Async stack trace, if any. (optional)
:exception-details Exception details if any. (optional)

set-skip-all-pauses

(set-skip-all-pauses)(set-skip-all-pauses {:as params, :keys [skip]})(set-skip-all-pauses connection {:as params, :keys [skip]})

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

Parameters map keys:

Key Description
:skip New value for skip pauses state.

set-variable-value

(set-variable-value)(set-variable-value {:as params, :keys [scope-number variable-name new-value call-frame-id]})(set-variable-value connection {:as params, :keys [scope-number variable-name new-value call-frame-id]})

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

Parameters map keys:

Key Description
:scope-number 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. :variable-name | Variable name. :new-value | New variable value. :call-frame-id | Id of callframe that holds variable.

step-into

(step-into)(step-into {:as params, :keys [break-on-async-call skip-list]})(step-into connection {:as params, :keys [break-on-async-call skip-list]})

Steps into the function call.

Parameters map keys:

Key Description
:break-on-async-call Debugger will pause on the execution of the first async task which was scheduled

before next pause. (optional) :skip-list | The skipList specifies location ranges that should be skipped on step into. (optional)

step-out

(step-out)(step-out {:as params, :keys []})(step-out connection {:as params, :keys []})

Steps out of the function call.

step-over

(step-over)(step-over {:as params, :keys [skip-list]})(step-over connection {:as params, :keys [skip-list]})

Steps over the statement.

Parameters map keys:

Key Description
:skip-list The skipList specifies location ranges that should be skipped on step over. (optional)