]> git.saurik.com Git - apple/javascriptcore.git/blob - inspector/protocol/Debugger.json
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / inspector / protocol / Debugger.json
1 {
2 "domain": "Debugger",
3 "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
4 "types": [
5 {
6 "id": "BreakpointId",
7 "type": "string",
8 "description": "Breakpoint identifier."
9 },
10 {
11 "id": "BreakpointActionIdentifier",
12 "type": "integer",
13 "description": "Breakpoint action identifier."
14 },
15 {
16 "id": "ScriptId",
17 "type": "string",
18 "description": "Unique script identifier."
19 },
20 {
21 "id": "CallFrameId",
22 "type": "string",
23 "description": "Call frame identifier."
24 },
25 {
26 "id": "Location",
27 "type": "object",
28 "properties": [
29 { "name": "scriptId", "$ref": "ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
30 { "name": "lineNumber", "type": "integer", "description": "Line number in the script." },
31 { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script." }
32 ],
33 "description": "Location in the source code."
34 },
35 {
36 "id": "BreakpointAction",
37 "type": "object",
38 "properties": [
39 { "name": "type", "type": "string", "enum": ["log", "evaluate", "sound", "probe"], "description": "Different kinds of breakpoint actions." },
40 { "name": "data", "type": "string", "optional": true, "description": "Data associated with this breakpoint type (e.g. for type \"eval\" this is the JavaScript string to evalulate)." },
41 { "name": "id", "$ref": "BreakpointActionIdentifier", "optional": true, "description": "A frontend-assigned identifier for this breakpoint action." }
42 ],
43 "description": "Action to perform when a breakpoint is triggered."
44 },
45 {
46 "id": "BreakpointOptions",
47 "type": "object",
48 "properties": [
49 { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." },
50 { "name": "actions", "type": "array", "optional": true, "items": { "$ref": "BreakpointAction" }, "description": "Actions to perform automatically when the breakpoint is triggered." },
51 { "name": "autoContinue", "type": "boolean", "optional": true, "description": "Automatically continue after hitting this breakpoint and running actions." }
52 ],
53 "description": "Extra options that modify breakpoint behavior."
54 },
55 {
56 "id": "FunctionDetails",
57 "type": "object",
58 "properties": [
59 { "name": "location", "$ref": "Location", "description": "Location of the function." },
60 { "name": "name", "type": "string", "optional": true, "description": "Name of the function. Not present for anonymous functions." },
61 { "name": "displayName", "type": "string", "optional": true, "description": "Display name of the function(specified in 'displayName' property on the function object)." },
62 { "name": "inferredName", "type": "string", "optional": true, "description": "Name of the function inferred from its initial assignment." },
63 { "name": "scopeChain", "type": "array", "optional": true, "items": { "$ref": "Scope" }, "description": "Scope chain for this closure." }
64 ],
65 "description": "Information about the function."
66 },
67 {
68 "id": "CallFrame",
69 "type": "object",
70 "properties": [
71 { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
72 { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
73 { "name": "location", "$ref": "Location", "description": "Location in the source code." },
74 { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },
75 { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." }
76 ],
77 "description": "JavaScript call frame. Array of call frames form the call stack."
78 },
79 {
80 "id": "Scope",
81 "type": "object",
82 "properties": [
83 { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch", "functionName"], "description": "Scope type." },
84 { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." }
85 ],
86 "description": "Scope description."
87 },
88 {
89 "id": "ProbeSample",
90 "description": "A sample collected by evaluating a probe breakpoint action.",
91 "type": "object",
92 "properties": [
93 { "name": "probeId", "$ref": "BreakpointActionIdentifier", "description": "Identifier of the probe breakpoint action that created the sample." },
94 { "name": "sampleId", "type": "integer", "description": "Unique identifier for this sample." },
95 { "name": "batchId", "type": "integer", "description": "A batch identifier which is the same for all samples taken at the same breakpoint hit." },
96 { "name": "timestamp", "type": "number", "description": "Timestamp of when the sample was taken." },
97 { "name": "payload", "$ref": "Runtime.RemoteObject", "description": "Contents of the sample." }
98 ]
99 },
100 {
101 "id": "AssertPauseReason",
102 "description": "The pause reason auxiliary data when paused because of an assertion.",
103 "type": "object",
104 "properties": [
105 { "name": "message", "type": "string", "optional": true, "description": "The console.assert message string if provided." }
106 ]
107 },
108 {
109 "id": "BreakpointPauseReason",
110 "description": "The pause reason auxiliary data when paused because of hitting a breakpoint.",
111 "type": "object",
112 "properties": [
113 { "name": "breakpointId", "type": "string", "description": "The identifier of the breakpoint causing the pause." }
114 ]
115 },
116 {
117 "id": "CSPViolationPauseReason",
118 "description": "The pause reason auxiliary data when paused because of a Content Security Policy directive.",
119 "type": "object",
120 "properties": [
121 { "name": "directive", "type": "string", "description": "The CSP directive that blocked script execution." }
122 ]
123 }
124 ],
125 "commands": [
126 {
127 "name": "enable",
128 "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
129 },
130 {
131 "name": "disable",
132 "description": "Disables debugger for given page."
133 },
134 {
135 "name": "setBreakpointsActive",
136 "parameters": [
137 { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }
138 ],
139 "description": "Activates / deactivates all breakpoints on the page."
140 },
141 {
142 "name": "setBreakpointByUrl",
143 "parameters": [
144 { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },
145 { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },
146 { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },
147 { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },
148 { "name": "options", "$ref": "BreakpointOptions", "optional": true, "description": "Options to apply to this breakpoint to modify its behavior." }
149 ],
150 "returns": [
151 { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
152 { "name": "locations", "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." }
153 ],
154 "description": "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 <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
155 },
156 {
157 "name": "setBreakpoint",
158 "parameters": [
159 { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },
160 { "name": "options", "$ref": "BreakpointOptions", "optional": true, "description": "Options to apply to this breakpoint to modify its behavior." }
161 ],
162 "returns": [
163 { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
164 { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
165 ],
166 "description": "Sets JavaScript breakpoint at a given location."
167 },
168 {
169 "name": "removeBreakpoint",
170 "parameters": [
171 { "name": "breakpointId", "$ref": "BreakpointId" }
172 ],
173 "description": "Removes JavaScript breakpoint."
174 },
175 {
176 "name": "continueToLocation",
177 "parameters": [
178 { "name": "location", "$ref": "Location", "description": "Location to continue to." }
179 ],
180 "description": "Continues execution until specific location is reached."
181 },
182 {
183 "name": "stepOver",
184 "description": "Steps over the statement."
185 },
186 {
187 "name": "stepInto",
188 "description": "Steps into the function call."
189 },
190 {
191 "name": "stepOut",
192 "description": "Steps out of the function call."
193 },
194 {
195 "name": "pause",
196 "description": "Stops on the next JavaScript statement."
197 },
198 {
199 "name": "resume",
200 "description": "Resumes JavaScript execution."
201 },
202 {
203 "name": "searchInContent",
204 "description": "Searches for given string in script content.",
205 "parameters": [
206 { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to search in." },
207 { "name": "query", "type": "string", "description": "String to search for." },
208 { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
209 { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
210 ],
211 "returns": [
212 { "name": "result", "type": "array", "items": { "$ref": "GenericTypes.SearchMatch" }, "description": "List of search matches." }
213 ]
214 },
215 {
216 "name": "getScriptSource",
217 "parameters": [
218 { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to get source for." }
219 ],
220 "returns": [
221 { "name": "scriptSource", "type": "string", "description": "Script source." }
222 ],
223 "description": "Returns source for the script with given id."
224 },
225 {
226 "name": "getFunctionDetails",
227 "parameters": [
228 { "name": "functionId", "$ref": "Runtime.RemoteObjectId", "description": "Id of the function to get location for." }
229 ],
230 "returns": [
231 { "name": "details", "$ref": "FunctionDetails", "description": "Information about the function." }
232 ],
233 "description": "Returns detailed information on given function."
234 },
235 {
236 "name": "setPauseOnExceptions",
237 "parameters": [
238 { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
239 ],
240 "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
241 },
242 {
243 "name": "evaluateOnCallFrame",
244 "parameters": [
245 { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
246 { "name": "expression", "type": "string", "description": "Expression to evaluate." },
247 { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
248 { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
249 { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state." },
250 { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
251 { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
252 { "name": "saveResult", "type": "boolean", "optional": true, "description": "Whether the resulting value should be considered for saving in the $n history." }
253 ],
254 "returns": [
255 { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
256 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
257 { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
258 ],
259 "description": "Evaluates expression on a given call frame."
260 },
261 {
262 "name": "setOverlayMessage",
263 "parameters": [
264 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
265 ],
266 "description": "Sets overlay message."
267 }
268 ],
269 "events": [
270 {
271 "name": "globalObjectCleared",
272 "description": "Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload."
273 },
274 {
275 "name": "scriptParsed",
276 "parameters": [
277 { "name": "scriptId", "$ref": "ScriptId", "description": "Identifier of the script parsed." },
278 { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
279 { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
280 { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
281 { "name": "endLine", "type": "integer", "description": "Last line of the script." },
282 { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
283 { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." },
284 { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
285 { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." }
286 ],
287 "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
288 },
289 {
290 "name": "scriptFailedToParse",
291 "parameters": [
292 { "name": "url", "type": "string", "description": "URL of the script that failed to parse." },
293 { "name": "scriptSource", "type": "string", "description": "Source text of the script that failed to parse." },
294 { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource." },
295 { "name": "errorLine", "type": "integer", "description": "Line with error." },
296 { "name": "errorMessage", "type": "string", "description": "Parse error message." }
297 ],
298 "description": "Fired when virtual machine fails to parse the script."
299 },
300 {
301 "name": "breakpointResolved",
302 "parameters": [
303 { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
304 { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
305 ],
306 "description": "Fired when breakpoint is resolved to an actual script and location."
307 },
308 {
309 "name": "paused",
310 "parameters": [
311 { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
312 { "name": "reason", "type": "string", "enum": ["XHR", "DOM", "EventListener", "exception", "assert", "CSPViolation", "DebuggerStatement", "Breakpoint", "PauseOnNextStatement", "other"], "description": "Pause reason." },
313 { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." }
314 ],
315 "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
316 },
317 {
318 "name": "resumed",
319 "description": "Fired when the virtual machine resumed execution."
320 },
321 {
322 "name": "didSampleProbe",
323 "description": "Fires when a new probe sample is collected.",
324 "parameters": [
325 { "name": "sample", "$ref": "ProbeSample", "description": "A collected probe sample." }
326 ]
327 },
328 {
329 "name": "playBreakpointActionSound",
330 "description": "Fired when a \"sound\" breakpoint action is triggered on a breakpoint.",
331 "parameters": [
332 { "name": "breakpointActionId", "$ref": "BreakpointActionIdentifier", "description": "Breakpoint action identifier." }
333 ]
334 }
335 ]
336 }