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