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