public interface Debugger
Modifier and Type | Method | Description |
---|---|---|
void |
continueToLocation(Location location) |
Continues execution until specific location is reached.
|
void |
continueToLocation(Location location,
TargetCallFrames targetCallFrames) |
Continues execution until specific location is reached.
|
void |
disable() |
Disables debugger for given page.
|
String |
enable() |
Enables debugger for the given page.
|
EvaluateOnCallFrameResult |
evaluateOnCallFrame(String callFrameId,
String expression) |
Evaluates expression on a given call frame.
|
EvaluateOnCallFrameResult |
evaluateOnCallFrame(String callFrameId,
String expression,
String objectGroup,
Boolean includeCommandLineAPI,
Boolean silent,
Boolean returnByValue,
Boolean generatePreview,
Boolean throwOnSideEffect,
Double timeout) |
Evaluates expression on a given call frame.
|
List<BreakLocation> |
getPossibleBreakpoints(Location start) |
Returns possible locations for breakpoint.
|
List<BreakLocation> |
getPossibleBreakpoints(Location start,
Location end,
Boolean restrictToFunction) |
Returns possible locations for breakpoint.
|
String |
getScriptSource(String scriptId) |
Returns source for the script with given id.
|
StackTrace |
getStackTrace(StackTraceId stackTraceId) |
Returns stack trace with given
stackTraceId . |
void |
pause() |
Stops on the next JavaScript statement.
|
void |
pauseOnAsyncCall(StackTraceId parentStackTraceId) |
|
void |
removeBreakpoint(String breakpointId) |
Removes JavaScript breakpoint.
|
RestartFrameResult |
restartFrame(String callFrameId) |
Restarts particular call frame from the beginning.
|
void |
resume() |
Resumes JavaScript execution.
|
void |
scheduleStepIntoAsync() |
This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and
Debugger.pauseOnAsyncTask instead.
|
List<SearchMatch> |
searchInContent(String scriptId,
String query) |
Searches for given string in script content.
|
List<SearchMatch> |
searchInContent(String scriptId,
String query,
Boolean caseSensitive,
Boolean isRegex) |
Searches for given string in script content.
|
void |
setAsyncCallStackDepth(Integer maxDepth) |
Enables or disables async call stacks tracking.
|
void |
setBlackboxedRanges(String scriptId,
List<ScriptPosition> positions) |
Makes backend skip steps in the script in blackboxed ranges.
|
void |
setBlackboxPatterns(List<String> patterns) |
Replace previous blackbox patterns with passed ones.
|
SetBreakpointResult |
setBreakpoint(Location location) |
Sets JavaScript breakpoint at a given location.
|
SetBreakpointResult |
setBreakpoint(Location location,
String condition) |
Sets JavaScript breakpoint at a given location.
|
SetBreakpointByUrlResult |
setBreakpointByUrl(Integer lineNumber) |
Sets JavaScript breakpoint at given location specified either by URL or URL regex.
|
SetBreakpointByUrlResult |
setBreakpointByUrl(Integer lineNumber,
String url,
String urlRegex,
String scriptHash,
Integer columnNumber,
String condition) |
Sets JavaScript breakpoint at given location specified either by URL or URL regex.
|
String |
setBreakpointOnFunctionCall(String objectId) |
Sets JavaScript breakpoint before each call to the given function.
|
String |
setBreakpointOnFunctionCall(String objectId,
String condition) |
Sets JavaScript breakpoint before each call to the given function.
|
void |
setBreakpointsActive(Boolean active) |
Activates / deactivates all breakpoints on the page.
|
void |
setPauseOnExceptions(PauseOnExceptionState state) |
Defines pause on exceptions state.
|
void |
setReturnValue(CallArgument newValue) |
Changes return value in top frame.
|
SetScriptSourceResult |
setScriptSource(String scriptId,
String scriptSource) |
Edits JavaScript source live.
|
SetScriptSourceResult |
setScriptSource(String scriptId,
String scriptSource,
Boolean dryRun) |
Edits JavaScript source live.
|
void |
setSkipAllPauses(Boolean skip) |
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
|
void |
setVariableValue(Integer scopeNumber,
String variableName,
CallArgument newValue,
String callFrameId) |
Changes value of variable in a callframe.
|
void |
stepInto() |
Steps into the function call.
|
void |
stepInto(Boolean breakOnAsyncCall) |
Steps into the function call.
|
void |
stepOut() |
Steps out of the function call.
|
void |
stepOver() |
Steps over the statement.
|
void continueToLocation(Location location, TargetCallFrames targetCallFrames)
location
- Location to continue to.void disable()
String enable()
EvaluateOnCallFrameResult evaluateOnCallFrame(String callFrameId, String expression, String objectGroup, Boolean includeCommandLineAPI, Boolean silent, Boolean returnByValue, Boolean generatePreview, Boolean throwOnSideEffect, Double timeout)
callFrameId
- Call frame identifier to evaluate on.expression
- Expression to evaluate.objectGroup
- String object group name to put result into (allows rapid releasing resulting object handles
using releaseObjectGroup
).includeCommandLineAPI
- Specifies whether command line API should be available to the evaluated expression, defaults
to false.silent
- In silent mode exceptions thrown during evaluation are not reported and do not pause
execution. Overrides setPauseOnException
state.returnByValue
- Whether the result is expected to be a JSON object that should be sent by value.generatePreview
- Whether preview should be generated for the result.throwOnSideEffect
- Whether to throw an exception if side effect cannot be ruled out during evaluation.timeout
- Terminate execution after timing out (number of milliseconds).List<BreakLocation> getPossibleBreakpoints(Location start, Location end, Boolean restrictToFunction)
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.restrictToFunction
- Only consider locations which are in the same (non-nested) function as start.String getScriptSource(String scriptId)
scriptId
- Id of the script to get source for.StackTrace getStackTrace(StackTraceId stackTraceId)
stackTraceId
.void pause()
void pauseOnAsyncCall(StackTraceId parentStackTraceId)
void removeBreakpoint(String breakpointId)
RestartFrameResult restartFrame(String callFrameId)
callFrameId
- Call frame identifier to evaluate on.void resume()
void scheduleStepIntoAsync()
List<SearchMatch> searchInContent(String scriptId, String query, Boolean caseSensitive, Boolean isRegex)
scriptId
- Id of the script to search in.query
- String to search for.caseSensitive
- If true, search is case sensitive.isRegex
- If true, treats string parameter as regex.void setAsyncCallStackDepth(Integer maxDepth)
maxDepth
- Maximum depth of async call stacks. Setting to 0
will effectively disable collecting async
call stacks (default).void setBlackboxPatterns(List<String> patterns)
patterns
- Array of regexps that will be used to check script url for blackbox state.void setBlackboxedRanges(String scriptId, List<ScriptPosition> positions)
scriptId
- Id of the script.SetBreakpointResult setBreakpoint(Location location, String condition)
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.SetBreakpointByUrlResult setBreakpointByUrl(Integer lineNumber, String url, String urlRegex, String scriptHash, Integer columnNumber, String condition)
locations
property. Further matching script parsing will result in subsequent
breakpointResolved
events issued. This logical breakpoint will survive page reloads.lineNumber
- Line number to set breakpoint at.url
- URL of the resources to set breakpoint on.urlRegex
- Regex pattern for the URLs of the resources to set breakpoints on. Either url
or
urlRegex
must be specified.scriptHash
- Script hash of the resources to set breakpoint on.columnNumber
- Offset in the line to set breakpoint at.condition
- Expression to use as a breakpoint condition. When specified, debugger will only stop on the
breakpoint if this expression evaluates to true.String setBreakpointOnFunctionCall(String objectId, String condition)
objectId
- 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.void setBreakpointsActive(Boolean active)
active
- New value for breakpoints active state.void setPauseOnExceptions(PauseOnExceptionState state)
none
.state
- Pause on exceptions mode.void setReturnValue(CallArgument newValue)
newValue
- New return value.SetScriptSourceResult setScriptSource(String scriptId, String scriptSource, Boolean dryRun)
scriptId
- Id of the script to edit.scriptSource
- New content of the script.dryRun
- If true the change will not actually be applied. Dry run may be used to get result
description without actually modifying the code.void setSkipAllPauses(Boolean skip)
skip
- New value for skip pauses state.void setVariableValue(Integer scopeNumber, String variableName, CallArgument newValue, String callFrameId)
scopeNumber
- 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
- Variable name.newValue
- New variable value.callFrameId
- Id of callframe that holds variable.void stepInto(Boolean breakOnAsyncCall)
breakOnAsyncCall
- Debugger will issue additional Debugger.paused notification if any async task is scheduled
before next pause.void stepOut()
void stepOver()
void continueToLocation(Location location)
location
- Location to continue to.EvaluateOnCallFrameResult evaluateOnCallFrame(String callFrameId, String expression)
callFrameId
- Call frame identifier to evaluate on.expression
- Expression to evaluate.List<BreakLocation> getPossibleBreakpoints(Location start)
start
- Start of range to search possible breakpoint locations in.List<SearchMatch> searchInContent(String scriptId, String query)
scriptId
- Id of the script to search in.query
- String to search for.SetBreakpointResult setBreakpoint(Location location)
location
- Location to set breakpoint in.SetBreakpointByUrlResult setBreakpointByUrl(Integer lineNumber)
locations
property. Further matching script parsing will result in subsequent
breakpointResolved
events issued. This logical breakpoint will survive page reloads.lineNumber
- Line number to set breakpoint at.String setBreakpointOnFunctionCall(String objectId)
objectId
- Function object id.SetScriptSourceResult setScriptSource(String scriptId, String scriptSource)
scriptId
- Id of the script to edit.scriptSource
- New content of the script.void stepInto()
Copyright © 2017, 2018–2018 WebFolder OÜ. All rights reserved.