public interface Debugger
Modifier and Type | Method and 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.
|
void |
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)
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.
|
void |
pause()
Stops on the next JavaScript statement.
|
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()
Steps into next scheduled async task if any is scheduled before next pause.
|
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.
|
void |
setBreakpointsActive(Boolean active)
Activates / deactivates all breakpoints on the page.
|
void |
setPauseOnExceptions(PauseOnExceptionState state)
Defines pause on exceptions state.
|
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 |
stepOut()
Steps out of the function call.
|
void |
stepOver()
Steps over the statement.
|
void enable()
void disable()
void setBreakpointsActive(Boolean active)
active
- New value for breakpoints active state.void setSkipAllPauses(Boolean skip)
skip
- New value for skip pauses state.SetBreakpointByUrlResult setBreakpointByUrl(Integer lineNumber, String url, String urlRegex, String scriptHash, Integer columnNumber, String condition)
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.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.void removeBreakpoint(String breakpointId)
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.void continueToLocation(Location location, TargetCallFrames targetCallFrames)
location
- Location to continue to.void stepOver()
void stepInto()
void stepOut()
void pause()
void scheduleStepIntoAsync()
void resume()
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.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.RestartFrameResult restartFrame(String callFrameId)
callFrameId
- Call frame identifier to evaluate on.String getScriptSource(String scriptId)
scriptId
- Id of the script to get source for.void setPauseOnExceptions(PauseOnExceptionState state)
state
- Pause on exceptions mode.EvaluateOnCallFrameResult evaluateOnCallFrame(String callFrameId, String expression, String objectGroup, Boolean includeCommandLineAPI, Boolean silent, Boolean returnByValue, Boolean generatePreview, Boolean throwOnSideEffect)
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.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 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.SetBreakpointByUrlResult setBreakpointByUrl(Integer lineNumber)
lineNumber
- Line number to set breakpoint at.SetBreakpointResult setBreakpoint(Location location)
location
- Location to set breakpoint in.List<BreakLocation> getPossibleBreakpoints(Location start)
start
- Start of range to search possible breakpoint locations in.void continueToLocation(Location location)
location
- Location to continue to.List<SearchMatch> searchInContent(String scriptId, String query)
scriptId
- Id of the script to search in.query
- String to search for.SetScriptSourceResult setScriptSource(String scriptId, String scriptSource)
scriptId
- Id of the script to edit.scriptSource
- New content of the script.EvaluateOnCallFrameResult evaluateOnCallFrame(String callFrameId, String expression)
callFrameId
- Call frame identifier to evaluate on.expression
- Expression to evaluate.Copyright © 2017 WebFolder OÜ. All rights reserved.