130224681df4d8ed23fe60e9017eae161ad99992
[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": "Setting",
8             "type": "string",
9             "description": "List of settings able to be overridden by WebInspector. Keep this in sync with FOR_EACH_INSPECTOR_OVERRIDE_SETTING.",
10             "enum": [
11                 "AuthorAndUserStylesEnabled",
12                 "ICECandidateFilteringEnabled",
13                 "ImagesEnabled",
14                 "MediaCaptureRequiresSecureConnection",
15                 "MockCaptureDevicesEnabled",
16                 "NeedsSiteSpecificQuirks",
17                 "ScriptEnabled",
18                 "WebRTCEncryptionEnabled",
19                 "WebSecurityEnabled"
20             ]
21         },
22         {
23             "id": "ResourceType",
24             "type": "string",
25             "enum": ["Document", "StyleSheet", "Image", "Font", "Script", "XHR", "Fetch", "Ping", "Beacon", "WebSocket", "Other"],
26             "description": "Resource type as it was perceived by the rendering engine."
27         },
28         {
29             "id": "CoordinateSystem",
30             "type": "string",
31             "enum": ["Viewport", "Page"],
32             "description": "Coordinate system used by supplied coordinates."
33         },
34         {
35             "id": "CookieSameSitePolicy",
36             "type": "string",
37             "enum": ["None", "Lax", "Strict"],
38             "description": "Same-Site policy of a cookie."
39         },
40         {
41             "id": "Appearance",
42             "type": "string",
43             "enum": ["Light", "Dark"],
44             "description": "Page appearance name."
45         },
46         {
47             "id": "Frame",
48             "type": "object",
49             "description": "Information about the Frame on the page.",
50             "properties": [
51                 { "name": "id", "type": "string", "description": "Frame unique identifier." },
52                 { "name": "parentId", "type": "string", "optional": true, "description": "Parent frame identifier." },
53                 { "name": "loaderId", "$ref": "Network.LoaderId", "description": "Identifier of the loader associated with this frame." },
54                 { "name": "name", "type": "string", "optional": true, "description": "Frame's name as specified in the tag." },
55                 { "name": "url", "type": "string", "description": "Frame document's URL." },
56                 { "name": "securityOrigin", "type": "string", "description": "Frame document's security origin." },
57                 { "name": "mimeType", "type": "string", "description": "Frame document's mimeType as determined by the browser." }
58             ]
59         },
60         {
61             "id": "FrameResource",
62             "type": "object",
63             "properties": [
64                 { "name": "url", "type": "string", "description": "Resource URL." },
65                 { "name": "type", "$ref": "ResourceType", "description": "Type of this resource." },
66                 { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },
67                 { "name": "failed", "type": "boolean", "optional": true, "description": "True if the resource failed to load." },
68                 { "name": "canceled", "type": "boolean", "optional": true, "description": "True if the resource was canceled during loading." },
69                 { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." },
70                 { "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." }
71             ]
72         },
73         {
74             "id": "FrameResourceTree",
75             "type": "object",
76             "description": "Information about the Frame hierarchy along with their cached resources.",
77             "properties": [
78                 { "name": "frame", "$ref": "Frame", "description": "Frame information for this tree item." },
79                 { "name": "childFrames", "type": "array", "optional": true, "items": { "$ref": "FrameResourceTree" }, "description": "Child frames." },
80                 { "name": "resources", "type": "array", "items": { "$ref": "FrameResource" }, "description": "Information about frame resources." }
81             ]
82         },
83         {
84             "id": "SearchResult",
85             "type": "object",
86             "description": "Search result for resource.",
87             "properties": [
88                 { "name": "url", "type": "string", "description": "Resource URL." },
89                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Resource frame id." },
90                 { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." },
91                 { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Network request id." }
92             ]
93         },
94         {
95             "id": "Cookie",
96             "type": "object",
97             "description": "Cookie object",
98             "properties": [
99                 { "name": "name", "type": "string", "description": "Cookie name." },
100                 { "name": "value", "type": "string", "description": "Cookie value." },
101                 { "name": "domain", "type": "string", "description": "Cookie domain." },
102                 { "name": "path", "type": "string", "description": "Cookie path." },
103                 { "name": "expires", "type": "number", "description": "Cookie expires." },
104                 { "name": "size", "type": "integer", "description": "Cookie size." },
105                 { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." },
106                 { "name": "secure", "type": "boolean", "description": "True if cookie is secure." },
107                 { "name": "session", "type": "boolean", "description": "True in case of session cookie." },
108                 { "name": "sameSite", "$ref": "CookieSameSitePolicy", "description": "Cookie Same-Site policy." }
109             ]
110         }
111     ],
112     "commands": [
113         {
114             "name": "reload",
115             "description": "Reloads the main frame of the inspected page.",
116             "parameters": [
117                 { "name": "ignoreCache", "type": "boolean", "optional": true, "description": "If true, the page is reloaded from its origin without using cached resources." },
118                 { "name": "revalidateAllResources", "type": "boolean", "optional": true, "description": "If true, all cached subresources will be revalidated when the main resource loads. Otherwise, only expired cached subresources will be revalidated (the default behavior for most WebKit clients)." }
119             ]
120         },
121         {
122             "name": "navigate",
123             "description": "Navigates current page to the given URL.",
124             "parameters": [
125                 { "name": "url", "type": "string", "description": "URL to navigate the page to." }
126             ]
127         },
128         {
129             "name": "overrideUserAgent",
130             "description": "Override's the user agent of the inspected page",
131             "parameters": [
132                 { "name": "value", "type": "string", "optional": true, "description": "Value to override the user agent with. If this value is not provided, the override is removed. Overrides are removed when Web Inspector closes/disconnects." }
133             ]
134         },
135         {
136             "name": "overrideSetting",
137             "description": "Allows the frontend to override the inspected page's settings.",
138             "parameters": [
139                 { "name": "setting", "$ref": "Setting" },
140                 { "name": "value", "type": "boolean", "optional": true, "description": "Value to override the setting with. If this value is not provided, the override is removed. Overrides are removed when Web Inspector closes/disconnects." }
141             ]
142         },
143         {
144             "name": "getCookies",
145             "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field.",
146             "returns": [
147                 { "name": "cookies", "type": "array", "items": { "$ref": "Cookie"}, "description": "Array of cookie objects." }
148             ]
149         },
150         {
151             "name": "deleteCookie",
152             "description": "Deletes browser cookie with given name, domain and path.",
153             "parameters": [
154                 { "name": "cookieName", "type": "string", "description": "Name of the cookie to remove." },
155                 { "name": "url", "type": "string", "description": "URL to match cookie domain and path." }
156             ]
157         },
158         {
159             "name": "getResourceTree",
160             "description": "Returns present frame / resource tree structure.",
161             "returns": [
162                 { "name": "frameTree", "$ref": "FrameResourceTree", "description": "Present frame / resource tree structure." }
163             ]
164         },
165         {
166             "name": "getResourceContent",
167             "description": "Returns content of the given resource.",
168             "parameters": [
169                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to get resource for." },
170                 { "name": "url", "type": "string", "description": "URL of the resource to get content for." }
171             ],
172             "returns": [
173                 { "name": "content", "type": "string", "description": "Resource content." },
174                 { "name": "base64Encoded", "type": "boolean", "description": "True, if content was served as base64." }
175             ]
176         },
177         {
178             "name": "searchInResource",
179             "description": "Searches for given string in resource content.",
180             "parameters": [
181                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id for resource to search in." },
182                 { "name": "url", "type": "string", "description": "URL of the resource to search in." },
183                 { "name": "query", "type": "string", "description": "String to search for." },
184                 { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
185                 { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." },
186                 { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Request id for resource to search in." }
187             ],
188             "returns": [
189                 { "name": "result", "type": "array", "items": { "$ref": "GenericTypes.SearchMatch" }, "description": "List of search matches." }
190             ]
191         },
192         {
193             "name": "searchInResources",
194             "description": "Searches for given string in frame / resource tree structure.",
195             "parameters": [
196                 { "name": "text", "type": "string", "description": "String to search for." },
197                 { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
198                 { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
199             ],
200             "returns": [
201                 { "name": "result", "type": "array", "items": { "$ref": "SearchResult" }, "description": "List of search results." }
202             ]
203         },
204         {
205             "name": "setShowRulers",
206             "description": "Requests that backend draw rulers in the inspector overlay",
207             "parameters": [
208                 { "name": "result", "type": "boolean", "description": "True for showing rulers" }
209             ]
210         },
211         {
212             "name": "setShowPaintRects",
213             "description": "Requests that backend shows paint rectangles",
214             "parameters": [
215                 { "name": "result", "type": "boolean", "description": "True for showing paint rectangles" }
216             ]
217         },
218         {
219             "name": "setEmulatedMedia",
220             "description": "Emulates the given media for CSS media queries.",
221             "parameters": [
222                 { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." }
223             ]
224         },
225         {
226             "name": "setForcedAppearance",
227             "description": "Forces the given appearance for the page.",
228             "parameters": [
229                 { "name": "appearance", "$ref": "Appearance", "description": "Appearance name to force. Empty string disables the override." }
230             ]
231         },
232         {
233             "name": "getCompositingBordersVisible",
234             "description": "Indicates the visibility of compositing borders.",
235             "returns": [
236                 { "name": "result", "type": "boolean", "description": "If true, compositing borders are visible." }
237             ]
238         },
239         {
240             "name": "setCompositingBordersVisible",
241             "description": "Controls the visibility of compositing borders.",
242             "parameters": [
243                 { "name": "visible", "type": "boolean", "description": "True for showing compositing borders." }
244             ]
245         },
246         {
247             "name": "snapshotNode",
248             "description": "Capture a snapshot of the specified node that does not include unrelated layers.",
249             "parameters": [
250                 { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Id of the node to snapshot." }
251             ],
252             "returns": [
253                 { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." }
254             ]
255         },
256         {
257             "name": "snapshotRect",
258             "description": "Capture a snapshot of the page within the specified rectangle and coordinate system.",
259             "parameters": [
260                 { "name": "x", "type": "integer", "description": "X coordinate" },
261                 { "name": "y", "type": "integer", "description": "Y coordinate" },
262                 { "name": "width", "type": "integer", "description": "Rectangle width" },
263                 { "name": "height", "type": "integer", "description": "Rectangle height" },
264                 { "name": "coordinateSystem", "$ref": "CoordinateSystem", "description": "Indicates the coordinate system of the supplied rectangle." }
265             ],
266             "returns": [
267                 { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." }
268             ]
269         },
270         {
271             "name": "archive",
272             "description": "Grab an archive of the page.",
273             "returns": [
274                 { "name": "data", "type": "string", "description": "Base64-encoded web archive." }
275             ]
276         }
277     ],
278     "events": [
279         {
280             "name": "domContentEventFired",
281             "parameters": [
282                 { "name": "timestamp", "type": "number" }
283             ]
284         },
285         {
286             "name": "loadEventFired",
287             "parameters": [
288                 { "name": "timestamp", "type": "number" }
289             ]
290         },
291         {
292             "name": "frameNavigated",
293             "description": "Fired once navigation of the frame has completed. Frame is now associated with the new loader.",
294             "parameters": [
295                 { "name": "frame", "$ref": "Frame", "description": "Frame object." }
296             ]
297         },
298         {
299             "name": "frameDetached",
300             "description": "Fired when frame has been detached from its parent.",
301             "parameters": [
302                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." }
303             ]
304         },
305         {
306             "name": "frameStartedLoading",
307             "description": "Fired when frame has started loading.",
308             "parameters": [
309                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has started loading." }
310             ]
311         },
312         {
313             "name": "frameStoppedLoading",
314             "description": "Fired when frame has stopped loading.",
315             "parameters": [
316                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has stopped loading." }
317             ]
318         },
319         {
320             "name": "frameScheduledNavigation",
321             "description": "Fired when frame schedules a potential navigation.",
322             "parameters": [
323                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." },
324                 { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." }
325             ]
326         },
327         {
328             "name": "frameClearedScheduledNavigation",
329             "description": "Fired when frame no longer has a scheduled navigation.",
330             "parameters": [
331                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }
332             ]
333         },
334         {
335             "name": "defaultAppearanceDidChange",
336             "description": "Fired when page's default appearance changes, even if there is a forced appearance.",
337             "parameters": [
338                 { "name": "appearance", "$ref": "Appearance", "description": "Name of the appearance that is active (not considering any forced appearance.)" }
339             ]
340         }
341     ]
342 }