139476cf7902f3d0172d74c54acc0e9f7272e628
[WebKit-https.git] / Source / JavaScriptCore / inspector / protocol / Page.json
1 {
2     "domain": "Page",
3     "description": "Actions and events related to the inspected page belong to the page domain.",
4     "availability": "web",
5     "types": [
6         {
7             "id": "ResourceType",
8             "type": "string",
9             "enum": ["Document", "Stylesheet", "Image", "Font", "Script", "XHR", "WebSocket", "Other"],
10             "description": "Resource type as it was perceived by the rendering engine."
11         },
12         {
13             "id": "CoordinateSystem",
14             "type": "string",
15             "enum": ["Viewport", "Page"],
16             "description": "Coordinate system used by supplied coordinates."
17         },
18         {
19             "id": "Frame",
20             "type": "object",
21             "description": "Information about the Frame on the page.",
22             "properties": [
23                 { "name": "id", "type": "string", "description": "Frame unique identifier." },
24                 { "name": "parentId", "type": "string", "optional": true, "description": "Parent frame identifier." },
25                 { "name": "loaderId", "$ref": "Network.LoaderId", "description": "Identifier of the loader associated with this frame." },
26                 { "name": "name", "type": "string", "optional": true, "description": "Frame's name as specified in the tag." },
27                 { "name": "url", "type": "string", "description": "Frame document's URL." },
28                 { "name": "securityOrigin", "type": "string", "description": "Frame document's security origin." },
29                 { "name": "mimeType", "type": "string", "description": "Frame document's mimeType as determined by the browser." }
30             ]
31         },
32         {
33             "id": "FrameResource",
34             "type": "object",
35             "properties": [
36                 { "name": "url", "type": "string", "description": "Resource URL." },
37                 { "name": "type", "$ref": "ResourceType", "description": "Type of this resource." },
38                 { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },
39                 { "name": "failed", "type": "boolean", "optional": true, "description": "True if the resource failed to load." },
40                 { "name": "canceled", "type": "boolean", "optional": true, "description": "True if the resource was canceled during loading." },
41                 { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." },
42                 { "name": "targetId", "type": "string", "optional": true, "description": "Identifier for the context of where the load originated. In general this is the target identifier. For Workers this will be the workerId." }
43             ]
44         },
45         {
46             "id": "FrameResourceTree",
47             "type": "object",
48             "description": "Information about the Frame hierarchy along with their cached resources.",
49             "properties": [
50                 { "name": "frame", "$ref": "Frame", "description": "Frame information for this tree item." },
51                 { "name": "childFrames", "type": "array", "optional": true, "items": { "$ref": "FrameResourceTree" }, "description": "Child frames." },
52                 { "name": "resources", "type": "array", "items": { "$ref": "FrameResource" }, "description": "Information about frame resources." }
53             ]
54         },
55         {
56             "id": "SearchResult",
57             "type": "object",
58             "description": "Search result for resource.",
59             "properties": [
60                 { "name": "url", "type": "string", "description": "Resource URL." },
61                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Resource frame id." },
62                 { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." },
63                 { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Network request id." }
64             ]
65         },
66         {
67             "id": "Cookie",
68             "type": "object",
69             "description": "Cookie object",
70             "properties": [
71                 { "name": "name", "type": "string", "description": "Cookie name." },
72                 { "name": "value", "type": "string", "description": "Cookie value." },
73                 { "name": "domain", "type": "string", "description": "Cookie domain." },
74                 { "name": "path", "type": "string", "description": "Cookie path." },
75                 { "name": "expires", "type": "number", "description": "Cookie expires." },
76                 { "name": "size", "type": "integer", "description": "Cookie size." },
77                 { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." },
78                 { "name": "secure", "type": "boolean", "description": "True if cookie is secure." },
79                 { "name": "session", "type": "boolean", "description": "True in case of session cookie." }
80             ]
81         },
82         {
83             "id": "ScriptIdentifier",
84             "type": "string",
85             "description": "Unique script identifier."
86         }
87     ],
88     "commands": [
89         {
90             "name": "enable",
91             "description": "Enables page domain notifications."
92         },
93         {
94             "name": "disable",
95             "description": "Disables page domain notifications."
96         },
97         {
98             "name": "addScriptToEvaluateOnLoad",
99             "parameters": [
100                 { "name": "scriptSource", "type": "string" }
101             ],
102             "returns": [
103                 { "name": "identifier", "$ref": "ScriptIdentifier", "description": "Identifier of the added script." }
104             ]
105         },
106         {
107             "name": "removeScriptToEvaluateOnLoad",
108             "parameters": [
109                 { "name": "identifier", "$ref": "ScriptIdentifier" }
110             ]
111         },
112         {
113             "name": "reload",
114             "parameters": [
115                 { "name": "ignoreCache", "type": "boolean", "optional": true, "description": "If true, browser cache is ignored (as if the user pressed Shift+refresh)." },
116                 { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." }
117             ],
118             "description": "Reloads given page optionally ignoring the cache."
119         },
120         {
121             "name": "navigate",
122             "parameters": [
123                 { "name": "url", "type": "string", "description": "URL to navigate the page to." }
124             ],
125             "description": "Navigates current page to the given URL."
126         },
127         {
128             "name": "getCookies",
129             "returns": [
130                 { "name": "cookies", "type": "array", "items": { "$ref": "Cookie"}, "description": "Array of cookie objects." }
131             ],
132             "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field."
133         },
134         {
135             "name": "deleteCookie",
136             "parameters": [
137                 { "name": "cookieName", "type": "string", "description": "Name of the cookie to remove." },
138                 { "name": "url", "type": "string", "description": "URL to match cooke domain and path." }
139             ],
140             "description": "Deletes browser cookie with given name, domain and path."
141         },
142         {
143             "name": "getResourceTree",
144             "description": "Returns present frame / resource tree structure.",
145             "returns": [
146                 { "name": "frameTree", "$ref": "FrameResourceTree", "description": "Present frame / resource tree structure." }
147             ]
148         },
149         {
150             "name": "getResourceContent",
151             "description": "Returns content of the given resource.",
152             "parameters": [
153                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to get resource for." },
154                 { "name": "url", "type": "string", "description": "URL of the resource to get content for." }
155             ],
156             "returns": [
157                 { "name": "content", "type": "string", "description": "Resource content." },
158                 { "name": "base64Encoded", "type": "boolean", "description": "True, if content was served as base64." }
159             ]
160         },
161         {
162             "name": "searchInResource",
163             "description": "Searches for given string in resource content.",
164             "parameters": [
165                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id for resource to search in." },
166                 { "name": "url", "type": "string", "description": "URL of the resource to search in." },
167                 { "name": "query", "type": "string", "description": "String to search for." },
168                 { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
169                 { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." },
170                 { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Request id for resource to search in." }
171             ],
172             "returns": [
173                 { "name": "result", "type": "array", "items": { "$ref": "GenericTypes.SearchMatch" }, "description": "List of search matches." }
174             ]
175         },
176         {
177             "name": "searchInResources",
178             "description": "Searches for given string in frame / resource tree structure.",
179             "parameters": [
180                 { "name": "text", "type": "string", "description": "String to search for." },
181                 { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
182                 { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
183             ],
184             "returns": [
185                 { "name": "result", "type": "array", "items": { "$ref": "SearchResult" }, "description": "List of search results." }
186             ]
187         },
188         {
189             "name": "setDocumentContent",
190             "description": "Sets given markup as the document's HTML.",
191             "parameters": [
192                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to set HTML for." },
193                 { "name": "html", "type": "string", "description": "HTML content to set."  }
194             ]
195         },
196         {
197             "name": "setShowPaintRects",
198             "description": "Requests that backend shows paint rectangles",
199             "parameters": [
200                 { "name": "result", "type": "boolean", "description": "True for showing paint rectangles" }
201             ]
202         },
203         {
204             "name": "getScriptExecutionStatus",
205             "description": "Determines if scripts can be executed in the page.",
206             "returns": [
207                 { "name": "result", "type": "string", "enum": ["allowed", "disabled", "forbidden"], "description": "Script execution status: \"allowed\" if scripts can be executed, \"disabled\" if script execution has been disabled through page settings, \"forbidden\" if script execution for the given page is not possible for other reasons." }
208             ]
209         },
210         {
211             "name": "setScriptExecutionDisabled",
212             "description": "Switches script execution in the page.",
213             "parameters": [
214                 { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." }
215             ]
216         },
217         {
218             "name": "setTouchEmulationEnabled",
219             "parameters": [
220                 { "name": "enabled", "type": "boolean", "description": "Whether the touch event emulation should be enabled." }
221             ],
222             "description": "Toggles mouse event-based touch event emulation."
223         },
224         {
225             "name": "setEmulatedMedia",
226             "parameters": [
227                 { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." }
228             ],
229             "description": "Emulates the given media for CSS media queries."
230         },
231         {
232             "name": "getCompositingBordersVisible",
233             "description": "Indicates the visibility of compositing borders.",
234             "returns": [
235                 { "name": "result", "type": "boolean", "description": "If true, compositing borders are visible." }
236             ]
237         },
238         {
239             "name": "setCompositingBordersVisible",
240             "description": "Controls the visibility of compositing borders.",
241             "parameters": [
242                 { "name": "visible", "type": "boolean", "description": "True for showing compositing borders." }
243             ]
244         },
245         {
246             "name": "snapshotNode",
247             "description": "Capture a snapshot of the specified node that does not include unrelated layers.",
248             "parameters": [
249                 { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Id of the node to snapshot." }
250             ],
251             "returns": [
252                 { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." }
253             ]
254         },
255         {
256             "name": "snapshotRect",
257             "description": "Capture a snapshot of the page within the specified rectangle and coordinate system.",
258             "parameters": [
259                 { "name": "x", "type": "integer", "description": "X coordinate" },
260                 { "name": "y", "type": "integer", "description": "Y coordinate" },
261                 { "name": "width", "type": "integer", "description": "Rectangle width" },
262                 { "name": "height", "type": "integer", "description": "Rectangle height" },
263                 { "name": "coordinateSystem", "$ref": "CoordinateSystem", "description": "Indicates the coordinate system of the supplied rectangle." }
264             ],
265             "returns": [
266                 { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." }
267             ]
268         },
269         {
270             "name": "handleJavaScriptDialog",
271             "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
272             "parameters": [
273                 { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
274                 { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
275             ]
276         },
277         {
278             "name": "archive",
279             "description": "Grab an archive of the page.",
280             "returns": [
281                 { "name": "data", "type": "string", "description": "Base64-encoded web archive." }
282             ]
283         }
284     ],
285     "events": [
286         {
287             "name": "domContentEventFired",
288             "parameters": [
289                 { "name": "timestamp", "type": "number" }
290             ]
291         },
292         {
293             "name": "loadEventFired",
294             "parameters": [
295                 { "name": "timestamp", "type": "number" }
296             ]
297         },
298         {
299             "name": "frameNavigated",
300             "description": "Fired once navigation of the frame has completed. Frame is now associated with the new loader.",
301             "parameters": [
302                 { "name": "frame", "$ref": "Frame", "description": "Frame object." }
303             ]
304         },
305         {
306             "name": "frameDetached",
307             "description": "Fired when frame has been detached from its parent.",
308             "parameters": [
309                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." }
310             ]
311         },
312         {
313             "name": "frameStartedLoading",
314             "description": "Fired when frame has started loading.",
315             "parameters": [
316                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has started loading." }
317             ]
318         },
319         {
320             "name": "frameStoppedLoading",
321             "description": "Fired when frame has stopped loading.",
322             "parameters": [
323                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has stopped loading." }
324             ]
325         },
326         {
327             "name": "frameScheduledNavigation",
328             "description": "Fired when frame schedules a potential navigation.",
329             "parameters": [
330                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." },
331                 { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." }
332             ]
333         },
334         {
335             "name": "frameClearedScheduledNavigation",
336             "description": "Fired when frame no longer has a scheduled navigation.",
337             "parameters": [
338                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }
339             ]
340         },
341         {
342             "name": "javascriptDialogOpening",
343             "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.",
344             "parameters": [
345                 { "name": "message", "type": "string", "description": "Message that will be displayed by the dialog." }
346             ]
347         },
348         {
349             "name": "javascriptDialogClosed",
350             "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed."
351         },
352         {
353             "name": "scriptsEnabled",
354             "description": "Fired when the JavaScript is enabled/disabled on the page",
355             "parameters": [
356                 { "name": "isEnabled", "type": "boolean", "description": "Whether script execution is enabled or disabled on the page." }
357             ]
358         }
359     ]
360 }