Web Inspector: Network: add button to show system certificate dialog
[WebKit-https.git] / Source / JavaScriptCore / inspector / protocol / Network.json
1 {
2     "domain": "Network",
3     "description": "Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.",
4     "availability": ["web", "service-worker"],
5     "types": [
6         {
7             "id": "LoaderId",
8             "type": "string",
9             "description": "Unique loader identifier."
10         },
11         {
12             "id": "FrameId",
13             "type": "string",
14             "description": "Unique frame identifier."
15         },
16         {
17             "id": "RequestId",
18             "type": "string",
19             "description": "Unique request identifier."
20         },
21         {
22             "id": "Timestamp",
23             "type": "number",
24             "description": "Elapsed seconds since frontend connected."
25         },
26         {
27             "id": "Walltime",
28             "type": "number",
29             "description": "Number of seconds since epoch."
30         },
31         {
32             "id": "Headers",
33             "type": "object",
34             "description": "Request / response headers as keys / values of JSON object."
35         },
36         {
37             "id": "ResourceTiming",
38             "type": "object",
39             "description": "Timing information for the request.",
40             "properties": [
41                 { "name": "startTime", "$ref": "Timestamp", "description": "Request is initiated" },
42                 { "name": "redirectStart", "$ref": "Timestamp", "description": "Started redirect resolution." },
43                 { "name": "redirectEnd", "$ref": "Timestamp", "description": "Finished redirect resolution." },
44                 { "name": "fetchStart", "$ref": "Timestamp", "description": "Resource fetching started." },
45                 { "name": "domainLookupStart", "type": "number", "description": "Started DNS address resolve in milliseconds relative to fetchStart." },
46                 { "name": "domainLookupEnd", "type": "number", "description": "Finished DNS address resolve in milliseconds relative to fetchStart." },
47                 { "name": "connectStart", "type": "number", "description": "Started connecting to the remote host in milliseconds relative to fetchStart." },
48                 { "name": "connectEnd", "type": "number", "description": "Connected to the remote host in milliseconds relative to fetchStart." },
49                 { "name": "secureConnectionStart", "type": "number", "description": "Started SSL handshake in milliseconds relative to fetchStart." },
50                 { "name": "requestStart", "type": "number", "description": "Started sending request in milliseconds relative to fetchStart." },
51                 { "name": "responseStart", "type": "number", "description": "Started receiving response headers in milliseconds relative to fetchStart." },
52                 { "name": "responseEnd", "type": "number", "description": "Finished receiving response headers in milliseconds relative to fetchStart." }
53             ]
54         },
55         {
56             "id": "Request",
57             "type": "object",
58             "description": "HTTP request data.",
59             "properties": [
60                 { "name": "url", "type": "string", "description": "Request URL." },
61                 { "name": "method", "type": "string", "description": "HTTP request method." },
62                 { "name": "headers", "$ref": "Headers", "description": "HTTP request headers." },
63                 { "name": "postData", "type": "string", "optional": true, "description": "HTTP POST request data." }
64             ]
65         },
66         {
67             "id": "Response",
68             "type": "object",
69             "description": "HTTP response data.",
70             "properties": [
71                 { "name": "url", "type": "string", "description": "Response URL. This URL can be different from CachedResource.url in case of redirect." },
72                 { "name": "status", "type": "integer", "description": "HTTP response status code." },
73                 { "name": "statusText", "type": "string", "description": "HTTP response status text." },
74                 { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." },
75                 { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },
76                 { "name": "source", "type": "string", "enum": ["unknown", "network", "memory-cache", "disk-cache", "service-worker"], "description": "Specifies where the response came from." },
77                 { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },
78                 { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." },
79                 { "name": "security", "$ref": "Security.Security", "optional": true, "description": "The security information for the given request." }
80             ]
81         },
82         {
83             "id": "Metrics",
84             "type": "object",
85             "description": "Network load metrics.",
86             "properties": [
87                 { "name": "protocol", "type": "string", "optional": true, "description": "Network protocol. ALPN Protocol ID Identification Sequence, as per RFC 7301 (for example, http/2, http/1.1, spdy/3.1)" },
88                 { "name": "priority", "type": "string", "enum": ["low", "medium", "high"], "optional": true, "description": "Network priority." },
89                 { "name": "connectionIdentifier", "type": "string", "optional": true, "description": "Connection identifier." },
90                 { "name": "remoteAddress", "type": "string", "optional": true, "description": "Remote IP address." },
91                 { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },
92                 { "name": "requestHeaderBytesSent", "type": "number", "optional": true, "description": "Total HTTP request header bytes sent over the network." },
93                 { "name": "requestBodyBytesSent", "type": "number", "optional": true, "description": "Total HTTP request body bytes sent over the network." },
94                 { "name": "responseHeaderBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response header bytes received over the network." },
95                 { "name": "responseBodyBytesReceived", "type": "number", "optional": true, "description": "Total HTTP response body bytes received over the network." },
96                 { "name": "responseBodyDecodedSize", "type": "number", "optional": true, "description": "Total decoded response body size in bytes." }
97             ]
98         },
99         {
100             "id": "WebSocketRequest",
101             "type": "object",
102             "description": "WebSocket request data.",
103             "properties": [
104                 { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }
105             ]
106         },
107         {
108             "id": "WebSocketResponse",
109             "type": "object",
110             "description": "WebSocket response data.",
111             "properties": [
112                 { "name": "status", "type": "integer", "description": "HTTP response status code." },
113                 { "name": "statusText", "type": "string", "description": "HTTP response status text." },
114                 { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }
115             ]
116         },
117         {
118             "id": "WebSocketFrame",
119             "type": "object",
120             "description": "WebSocket frame data.",
121             "properties": [
122                 { "name": "opcode", "type": "number", "description": "WebSocket frame opcode." },
123                 { "name": "mask", "type": "boolean", "description": "WebSocket frame mask." },
124                 { "name": "payloadData", "type": "string", "description": "WebSocket frame payload data." },
125                 { "name": "payloadLength", "type": "number", "description": "WebSocket frame payload length in bytes." }
126             ]
127         },
128         {
129             "id": "CachedResource",
130             "type": "object",
131             "description": "Information about the cached resource.",
132             "properties": [
133                 { "name": "url", "type": "string", "description": "Resource URL. This is the url of the original network request." },
134                 { "name": "type", "$ref": "Page.ResourceType", "description": "Type of this resource." },
135                 { "name": "response", "$ref": "Response", "optional": true, "description": "Cached response data." },
136                 { "name": "bodySize", "type": "number", "description": "Cached response body size." },
137                 { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." }
138             ]
139         },
140         {
141             "id": "Initiator",
142             "type": "object",
143             "description": "Information about the request initiator.",
144             "properties": [
145                 { "name": "type", "type": "string", "enum": ["parser", "script", "other"], "description": "Type of this initiator." },
146                 { "name": "stackTrace", "type": "array", "items": { "$ref": "Console.CallFrame" }, "optional": true, "description": "Initiator JavaScript stack trace, set for Script only." },
147                 { "name": "url", "type": "string", "optional": true, "description": "Initiator URL, set for Parser type only." },
148                 { "name": "lineNumber", "type": "number", "optional": true, "description": "Initiator line number, set for Parser type only." },
149                 { "name": "nodeId", "$ref": "DOM.NodeId", "optional": true, "description": "Set if the load was triggered by a DOM node, in addition to the other initiator information." }
150             ]
151         }
152     ],
153     "commands": [
154         {
155             "name": "enable",
156             "description": "Enables network tracking, network events will now be delivered to the client."
157         },
158         {
159             "name": "disable",
160             "description": "Disables network tracking, prevents network events from being sent to the client."
161         },
162         {
163             "name": "setExtraHTTPHeaders",
164             "description": "Specifies whether to always send extra HTTP headers with the requests from this page.",
165             "parameters": [
166                 { "name": "headers", "$ref": "Headers", "description": "Map with extra HTTP headers." }
167             ]
168         },
169         {
170             "name": "getResponseBody",
171             "description": "Returns content served for the given request.",
172             "parameters": [
173                 { "name": "requestId", "$ref": "RequestId", "description": "Identifier of the network request to get content for." }
174             ],
175             "returns": [
176                 { "name": "body", "type": "string", "description": "Response body." },
177                 { "name": "base64Encoded", "type": "boolean", "description": "True, if content was sent as base64." }
178             ]
179         },
180         {
181             "name": "setResourceCachingDisabled",
182             "description": "Toggles whether the resource cache may be used when loading resources in the inspected page. If <code>true</code>, the resource cache will not be used when loading resources.",
183             "parameters": [
184                 { "name": "disabled", "type": "boolean", "description": "Whether to prevent usage of the resource cache." }
185             ]
186         },
187         {
188             "name": "loadResource",
189             "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks.",
190             "async": true,
191             "parameters": [
192                 { "name": "frameId", "$ref": "FrameId", "description": "Frame to load the resource from." },
193                 { "name": "url", "type": "string", "description": "URL of the resource to load." }
194             ],
195             "returns": [
196                 { "name": "content", "type": "string", "description": "Resource content." },
197                 { "name": "mimeType", "type": "string", "description": "Resource mimeType." },
198                 { "name": "status", "type": "integer", "description": "HTTP response status code." }
199             ]
200         },
201         {
202             "name": "getSerializedCertificate",
203             "description": "Fetches a serialized secure certificate for the given requestId to be displayed via InspectorFrontendHost.showCertificate.",
204             "parameters": [
205                 { "name": "requestId", "$ref": "RequestId" }
206             ],
207             "returns": [
208                 { "name": "serializedCertificate", "type": "string", "description": "Represents a base64 encoded WebCore::CertificateInfo object." }
209             ]
210         },
211         {
212             "name": "resolveWebSocket",
213             "description": "Resolves JavaScript WebSocket object for given request id.",
214             "parameters": [
215                 { "name": "requestId", "$ref": "RequestId", "description": "Identifier of the WebSocket resource to resolve." },
216                 { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
217             ],
218             "returns": [
219                 { "name": "object", "$ref": "Runtime.RemoteObject", "description": "JavaScript object wrapper for given node." }
220             ]
221         }
222     ],
223     "events": [
224         {
225             "name": "requestWillBeSent",
226             "description": "Fired when page is about to send HTTP request.",
227             "parameters": [
228                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
229                 { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
230                 { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
231                 { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },
232                 { "name": "request", "$ref": "Request", "description": "Request data." },
233                 { "name": "timestamp", "$ref": "Timestamp" },
234                 { "name": "walltime", "$ref": "Walltime" },
235                 { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },
236                 { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." },
237                 { "name": "type", "$ref": "Page.ResourceType", "optional": true, "description": "Resource type." },
238                 { "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." }
239             ]
240         },
241         {
242             "name": "responseReceived",
243             "description": "Fired when HTTP response is available.",
244             "parameters": [
245                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
246                 { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
247                 { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
248                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
249                 { "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." },
250                 { "name": "response", "$ref": "Response", "description": "Response data." }
251             ]
252         },
253         {
254             "name": "dataReceived",
255             "description": "Fired when data chunk was received over the network.",
256             "parameters": [
257                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
258                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
259                 { "name": "dataLength", "type": "integer", "description": "Data chunk length." },
260                 { "name": "encodedDataLength", "type": "integer", "description": "Actual bytes received (might be less than dataLength for compressed encodings)." }
261             ]
262         },
263         {
264             "name": "loadingFinished",
265             "description": "Fired when HTTP request has finished loading.",
266             "parameters": [
267                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
268                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
269                 { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." },
270                 { "name": "metrics", "$ref": "Metrics", "optional": true, "description": "Network metrics." }
271             ]
272         },
273         {
274             "name": "loadingFailed",
275             "description": "Fired when HTTP request has failed to load.",
276             "parameters": [
277                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
278                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
279                 { "name": "errorText", "type": "string", "description": "User friendly error message." },
280                 { "name": "canceled", "type": "boolean", "optional": true, "description": "True if loading was canceled." }
281             ]
282         },
283         {
284             "name": "requestServedFromMemoryCache",
285             "description": "Fired when HTTP request has been served from memory cache.",
286             "parameters": [
287                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
288                 { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
289                 { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
290                 { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },
291                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
292                 { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },
293                 { "name": "resource", "$ref": "CachedResource", "description": "Cached resource data." }
294             ]
295         },
296         {
297             "name": "webSocketWillSendHandshakeRequest",
298             "description": "Fired when WebSocket is about to initiate handshake.",
299             "parameters": [
300                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
301                 { "name": "timestamp", "$ref": "Timestamp" },
302                 { "name": "walltime", "$ref": "Walltime" },
303                 { "name": "request", "$ref": "WebSocketRequest", "description": "WebSocket request data." }
304             ]
305         },
306         {
307             "name": "webSocketHandshakeResponseReceived",
308             "description": "Fired when WebSocket handshake response becomes available.",
309             "parameters": [
310                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
311                 { "name": "timestamp", "$ref": "Timestamp" },
312                 { "name": "response", "$ref": "WebSocketResponse", "description": "WebSocket response data." }
313             ]
314         },
315         {
316             "name": "webSocketCreated",
317             "description": "Fired upon WebSocket creation.",
318             "parameters": [
319                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
320                 { "name": "url", "type": "string", "description": "WebSocket request URL." }
321             ]
322         },
323         {
324             "name": "webSocketClosed",
325             "description": "Fired when WebSocket is closed.",
326             "parameters": [
327                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
328                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }
329             ]
330         },
331         {
332             "name": "webSocketFrameReceived",
333             "description": "Fired when WebSocket frame is received.",
334             "parameters": [
335                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
336                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
337                 { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }
338             ]
339         },
340         {
341             "name": "webSocketFrameError",
342             "description": "Fired when WebSocket frame error occurs.",
343             "parameters": [
344                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
345                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
346                 { "name": "errorMessage", "type": "string", "description": "WebSocket frame error message." }
347             ]
348         },
349         {
350             "name": "webSocketFrameSent",
351             "description": "Fired when WebSocket frame is sent.",
352             "parameters": [
353                 { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
354                 { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
355                 { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }
356             ]
357         }
358     ]
359 }