Module cdp::debugger
[−]
[src]
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
Debugger
Commands
-
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
-
Disables debugger for given page.
-
Activates / deactivates all breakpoints on the page.
-
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
-
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 subsequentbreakpointResolved
events issued. This logical breakpoint will survive page reloads. -
Sets JavaScript breakpoint at a given location.
-
Removes JavaScript breakpoint.
Debugger.getPossibleBreakpoints
ExperimentalReturns possible locations for breakpoint. scriptId in start and end range locations should be the same.
-
Continues execution until specific location is reached.
-
Steps over the statement.
-
Steps into the function call.
-
Steps out of the function call.
-
Stops on the next JavaScript statement.
Debugger.scheduleStepIntoAsync
ExperimentalSteps 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.
-
Resumes JavaScript execution.
Debugger.searchInContent
ExperimentalSearches for given string in script content.
-
Edits JavaScript source live.
-
Restarts particular call frame from the beginning.
-
Returns source for the script with given id.
-
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
. -
Evaluates expression on a given call frame.
-
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
Debugger.setAsyncCallStackDepth
Enables or disables async call stacks tracking.
Debugger.setBlackboxPatterns
ExperimentalReplace 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.
Debugger.setBlackboxedRanges
ExperimentalMakes 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.
Events
-
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
-
Fired when virtual machine fails to parse the script.
-
Fired when breakpoint is resolved to an actual script and location.
-
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
-
Fired when the virtual machine resumed execution.
Types
-
Breakpoint identifier.
-
Call frame identifier.
-
Location in the source code.
ScriptPosition
ExperimentalLocation in the source code.
-
JavaScript call frame. Array of call frames form the call stack.
-
Scope description.
SearchMatch
ExperimentalSearch match for resource.
BreakLocation
Experimental
Structs
BreakLocation |
[Experimental] |
BreakpointResolvedEvent |
Fired when breakpoint is resolved to an actual script and location. |
CallFrame |
JavaScript call frame. Array of call frames form the call stack. |
ContinueToLocationCommand |
Continues execution until specific location is reached. |
ContinueToLocationResponse |
Continues execution until specific location is reached. |
DisableCommand |
Disables debugger for given page. |
DisableResponse |
Disables debugger for given page. |
EnableCommand |
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. |
EnableResponse |
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. |
EvaluateOnCallFrameCommand |
Evaluates expression on a given call frame. |
EvaluateOnCallFrameResponse |
Evaluates expression on a given call frame. |
GetPossibleBreakpointsCommand |
[Experimental] Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. |
GetPossibleBreakpointsResponse |
[Experimental] Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. |
GetScriptSourceCommand |
Returns source for the script with given id. |
GetScriptSourceResponse |
Returns source for the script with given id. |
Location |
Location in the source code. |
PauseCommand |
Stops on the next JavaScript statement. |
PauseResponse |
Stops on the next JavaScript statement. |
PausedEvent |
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. |
RemoveBreakpointCommand |
Removes JavaScript breakpoint. |
RemoveBreakpointResponse |
Removes JavaScript breakpoint. |
RestartFrameCommand |
Restarts particular call frame from the beginning. |
RestartFrameResponse |
Restarts particular call frame from the beginning. |
ResumeCommand |
Resumes JavaScript execution. |
ResumeResponse |
Resumes JavaScript execution. |
ResumedEvent |
Fired when the virtual machine resumed execution. |
ScheduleStepIntoAsyncCommand |
[Experimental] 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. |
ScheduleStepIntoAsyncResponse |
[Experimental] 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. |
Scope |
Scope description. |
ScriptFailedToParseEvent |
Fired when virtual machine fails to parse the script. |
ScriptParsedEvent |
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. |
ScriptPosition |
[Experimental] Location in the source code. |
SearchInContentCommand |
[Experimental] Searches for given string in script content. |
SearchInContentResponse |
[Experimental] Searches for given string in script content. |
SearchMatch |
[Experimental] Search match for resource. |
SetAsyncCallStackDepthCommand |
Enables or disables async call stacks tracking. |
SetAsyncCallStackDepthResponse |
Enables or disables async call stacks tracking. |
SetBlackboxPatternsCommand |
[Experimental] 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. |
SetBlackboxPatternsResponse |
[Experimental] 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. |
SetBlackboxedRangesCommand |
[Experimental] 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. |
SetBlackboxedRangesResponse |
[Experimental] 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. |
SetBreakpointByUrlCommand |
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 |
SetBreakpointByUrlResponse |
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 |
SetBreakpointCommand |
Sets JavaScript breakpoint at a given location. |
SetBreakpointResponse |
Sets JavaScript breakpoint at a given location. |
SetBreakpointsActiveCommand |
Activates / deactivates all breakpoints on the page. |
SetBreakpointsActiveResponse |
Activates / deactivates all breakpoints on the page. |
SetPauseOnExceptionsCommand |
Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is |
SetPauseOnExceptionsResponse |
Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is |
SetScriptSourceCommand |
Edits JavaScript source live. |
SetScriptSourceResponse |
Edits JavaScript source live. |
SetSkipAllPausesCommand |
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). |
SetSkipAllPausesResponse |
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). |
SetVariableValueCommand |
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. |
SetVariableValueResponse |
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. |
StepIntoCommand |
Steps into the function call. |
StepIntoResponse |
Steps into the function call. |
StepOutCommand |
Steps out of the function call. |
StepOutResponse |
Steps out of the function call. |
StepOverCommand |
Steps over the statement. |
StepOverResponse |
Steps over the statement. |
Enums
BreakLocationType |
[Experimental] |
ContinueToLocationCommandTargetCallFrames |
Used in the type of |
PausedEventReason |
Used in the type of |
ScopeType |
Used in the type of |
SetPauseOnExceptionsCommandState |
Used in the type of |
Type Definitions
BreakpointId |
Breakpoint identifier. |
CallFrameId |
Call frame identifier. |