tot: Debugger
Contents
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
Commands
Debugger.canSetScriptSource
"id": <number>,
"method": "Debugger.canSetScriptSource"
"id": <number>,
"error": <object>,
"result": {
"result": <boolean>
}
Always returns true.
Returns
setScriptSource
is supported.
Debugger.continueToLocation
"id": <number>,
"method": "Debugger.continueToLocation",
"params": {
"location": <Location>
}
"id": <number>,
"error": <object>
Continues execution until specific location is reached.
Parameters
Debugger.disable
"id": <number>,
"method": "Debugger.disable"
"id": <number>,
"error": <object>
Disables debugger for given page.
Debugger.enable
"id": <number>,
"method": "Debugger.enable"
"id": <number>,
"error": <object>
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.evaluateOnCallFrame
"id": <number>,
"method": "Debugger.evaluateOnCallFrame",
"params": {
"callFrameId": <CallFrameId>,
"expression": <string>,
"objectGroup": <string>,
"returnByValue": <boolean>
}
"id": <number>,
"error": <object>,
"result": {
"result": <Runtime.RemoteObject>,
"wasThrown": <boolean>
}
Evaluates expression on a given call frame.
Parameters
releaseObjectGroup
).
Returns
Debugger.getScriptSource
"id": <number>,
"method": "Debugger.getScriptSource",
"params": {
"scriptId": <ScriptId>
}
"id": <number>,
"error": <object>,
"result": {
"scriptSource": <string>
}
Returns source for the script with given id.
Parameters
Returns
Debugger.pause
"id": <number>,
"method": "Debugger.pause"
"id": <number>,
"error": <object>
Stops on the next JavaScript statement.
Debugger.removeBreakpoint
"id": <number>,
"method": "Debugger.removeBreakpoint",
"params": {
"breakpointId": <BreakpointId>
}
"id": <number>,
"error": <object>
Debugger.resume
"id": <number>,
"method": "Debugger.resume"
"id": <number>,
"error": <object>
Resumes JavaScript execution.
Debugger.searchInContent
"id": <number>,
"method": "Debugger.searchInContent",
"params": {
"scriptId": <ScriptId>,
"query": <string>,
"caseSensitive": <boolean>,
"isRegex": <boolean>
}
"id": <number>,
"error": <object>,
"result": {
"result": <array of Page.SearchMatch>
}
Searches for given string in script content.
Parameters
Returns
Debugger.setBreakpoint
"id": <number>,
"method": "Debugger.setBreakpoint",
"params": {
"location": <Location>,
"condition": <string>
}
"id": <number>,
"error": <object>,
"result": {
"breakpointId": <BreakpointId>,
"actualLocation": <Location>
}
Sets JavaScript breakpoint at a given location.
Parameters
Returns
Debugger.setBreakpointByUrl
"id": <number>,
"method": "Debugger.setBreakpointByUrl",
"params": {
"lineNumber": <integer>,
"url": <string>,
"urlRegex": <string>,
"columnNumber": <integer>,
"condition": <string>
}
"id": <number>,
"error": <object>,
"result": {
"breakpointId": <BreakpointId>,
"locations": <array of Location>
}
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
url
or urlRegex
must be specified.
Returns
Debugger.setBreakpointsActive
"id": <number>,
"method": "Debugger.setBreakpointsActive",
"params": {
"active": <boolean>
}
"id": <number>,
"error": <object>
Activates / deactivates all breakpoints on the page.
Parameters
Debugger.setPauseOnExceptions
"id": <number>,
"method": "Debugger.setPauseOnExceptions",
"params": {
"state": <string>
}
"id": <number>,
"error": <object>
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
Debugger.setScriptSource
Debugger.stepInto
"id": <number>,
"method": "Debugger.stepInto"
"id": <number>,
"error": <object>
Steps into the function call.
Notifications
Debugger.breakpointResolved
"method": "Debugger.breakpointResolved",
"params": {
"breakpointId": <BreakpointId>,
"location": <Location>
}
Fired when breakpoint is resolved to an actual script and location.
Parameters
Debugger.globalObjectCleared
"method": "Debugger.globalObjectCleared"
Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload.
Debugger.paused
"method": "Debugger.paused",
"params": {
"callFrames": <array of CallFrame>,
"reason": <string>,
"data": <object>
}
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
Parameters
Debugger.scriptFailedToParse
"method": "Debugger.scriptFailedToParse",
"params": {
"url": <string>,
"scriptSource": <string>,
"startLine": <integer>,
"errorLine": <integer>,
"errorMessage": <string>
}
Fired when virtual machine fails to parse the script.
Parameters
Debugger.scriptParsed
"method": "Debugger.scriptParsed",
"params": {
"scriptId": <ScriptId>,
"url": <string>,
"startLine": <integer>,
"startColumn": <integer>,
"endLine": <integer>,
"endColumn": <integer>,
"isContentScript": <boolean>,
"sourceMapURL": <string>
}
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
Parameters
Types
CallFrame: object
this
object for this call frame.
Location: object
Debugger.scriptParsed
.
Scope: object
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.