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    "types": [
5        {
6            "id": "LoaderId",
7            "type": "string",
8            "description": "Unique loader identifier."
9        },
10        {
11            "id": "FrameId",
12            "type": "string",
13            "description": "Unique frame identifier."
14        },
15        {
16            "id": "RequestId",
17            "type": "string",
18            "description": "Unique request identifier."
19        },
20        {
21            "id": "Timestamp",
22            "type": "number",
23            "description": "Number of seconds since epoch."
24        },
25        {
26            "id": "Headers",
27            "type": "object",
28            "description": "Request / response headers as keys / values of JSON object."
29        },
30        {
31            "id": "ResourceTiming",
32            "type": "object",
33            "description": "Timing information for the request.",
34            "properties": [
35                { "name": "navigationStart", "type": "number", "description": "Timing's navigationStart is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this navigationStart." },
36                { "name": "domainLookupStart", "type": "number", "description": "Started DNS address resolve." },
37                { "name": "domainLookupEnd", "type": "number", "description": "Finished DNS address resolve." },
38                { "name": "connectStart", "type": "number", "description": "Started connecting to the remote host." },
39                { "name": "connectEnd", "type": "number", "description": "Connected to the remote host." },
40                { "name": "secureConnectionStart", "type": "number", "description": "Started SSL handshake." },
41                { "name": "requestStart", "type": "number", "description": "Started sending request." },
42                { "name": "responseStart", "type": "number", "description": "Started receiving response headers." }
43            ]
44        },
45        {
46            "id": "Request",
47            "type": "object",
48            "description": "HTTP request data.",
49            "properties": [
50                { "name": "url", "type": "string", "description": "Request URL." },
51                { "name": "method", "type": "string", "description": "HTTP request method." },
52                { "name": "headers", "$ref": "Headers", "description": "HTTP request headers." },
53                { "name": "postData", "type": "string", "optional": true, "description": "HTTP POST request data." }
54            ]
55        },
56        {
57            "id": "Response",
58            "type": "object",
59            "description": "HTTP response data.",
60            "properties": [
61                { "name": "url", "type": "string", "description": "Response URL. This URL can be different from CachedResource.url in case of redirect." },
62                { "name": "status", "type": "number", "description": "HTTP response status code." },
63                { "name": "statusText", "type": "string", "description": "HTTP response status text." },
64                { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." },
65                { "name": "headersText", "type": "string", "optional": true, "description": "HTTP response headers text." },
66                { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },
67                { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },
68                { "name": "requestHeadersText", "type": "string", "optional": true, "description": "HTTP request headers text." },
69                { "name": "connectionReused", "type": "boolean", "description": "Specifies whether physical connection was actually reused for this request." },
70                { "name": "connectionId", "type": "number", "description": "Physical connection id that was actually used for this request." },
71                { "name": "fromDiskCache", "type": "boolean", "optional": true, "description": "Specifies that the request was served from the disk cache." },
72                { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." }
73            ]
74        },
75        {
76            "id": "WebSocketRequest",
77            "type": "object",
78            "description": "WebSocket request data.",
79            "properties": [
80                { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }
81            ]
82        },
83        {
84            "id": "WebSocketResponse",
85            "type": "object",
86            "description": "WebSocket response data.",
87            "properties": [
88                { "name": "status", "type": "number", "description": "HTTP response status code." },
89                { "name": "statusText", "type": "string", "description": "HTTP response status text." },
90                { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }
91            ]
92        },
93        {
94            "id": "WebSocketFrame",
95            "type": "object",
96            "description": "WebSocket frame data.",
97            "properties": [
98                { "name": "opcode", "type": "number", "description": "WebSocket frame opcode." },
99                { "name": "mask", "type": "boolean", "description": "WebSocket frame mask." },
100                { "name": "payloadData", "type": "string", "description": "WebSocket frame payload data." }
101            ]
102        },
103        {
104            "id": "CachedResource",
105            "type": "object",
106            "description": "Information about the cached resource.",
107            "properties": [
108                { "name": "url", "type": "string", "description": "Resource URL. This is the url of the original network request." },
109                { "name": "type", "$ref": "Page.ResourceType", "description": "Type of this resource." },
110                { "name": "response", "$ref": "Response", "optional": true, "description": "Cached response data." },
111                { "name": "bodySize", "type": "number", "description": "Cached response body size." },
112                { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." }
113            ]
114        },
115        {
116            "id": "Initiator",
117            "type": "object",
118            "description": "Information about the request initiator.",
119            "properties": [
120                { "name": "type", "type": "string", "enum": ["parser", "script", "other"], "description": "Type of this initiator." },
121                { "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "Initiator JavaScript stack trace, set for Script only." },
122                { "name": "url", "type": "string", "optional": true, "description": "Initiator URL, set for Parser type only." },
123                { "name": "lineNumber", "type": "number", "optional": true, "description": "Initiator line number, set for Parser type only." }
124            ]
125        }
126    ],
127    "commands": [
128        {
129            "name": "enable",
130            "description": "Enables network tracking, network events will now be delivered to the client."
131        },
132        {
133            "name": "disable",
134            "description": "Disables network tracking, prevents network events from being sent to the client."
135        },
136        {
137            "name": "setExtraHTTPHeaders",
138            "description": "Specifies whether to always send extra HTTP headers with the requests from this page.",
139            "parameters": [
140                { "name": "headers", "$ref": "Headers", "description": "Map with extra HTTP headers." }
141            ]
142        },
143        {
144            "name": "getResponseBody",
145            "description": "Returns content served for the given request.",
146            "parameters": [
147                { "name": "requestId", "$ref": "RequestId", "description": "Identifier of the network request to get content for." }
148            ],
149            "returns": [
150                { "name": "body", "type": "string", "description": "Response body." },
151                { "name": "base64Encoded", "type": "boolean", "description": "True, if content was sent as base64." }
152            ]
153        },
154        {
155            "name": "replayXHR",
156            "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.",
157            "parameters": [
158                { "name": "requestId", "$ref": "RequestId", "description": "Identifier of XHR to replay." }
159            ]
160        },
161        {
162            "name": "canClearBrowserCache",
163            "description": "Tells whether clearing browser cache is supported.",
164            "returns": [
165                { "name": "result", "type": "boolean", "description": "True if browser cache can be cleared." }
166            ]
167        },
168        {
169            "name": "clearBrowserCache",
170            "description": "Clears browser cache."
171        },
172        {
173            "name": "canClearBrowserCookies",
174            "description": "Tells whether clearing browser cookies is supported.",
175            "returns": [
176                { "name": "result", "type": "boolean", "description": "True if browser cookies can be cleared." }
177            ]
178        },
179        {
180            "name": "clearBrowserCookies",
181            "description": "Clears browser cookies."
182        },
183        {
184            "name": "setCacheDisabled",
185            "parameters": [
186                { "name": "cacheDisabled", "type": "boolean", "description": "Cache disabled state." }
187            ],
188            "description": "Toggles ignoring cache for each request. If <code>true</code>, cache will not be used."
189        },
190        {
191            "name": "loadResource",
192            "async": true,
193            "parameters": [
194                { "name": "frameId", "$ref": "FrameId", "description": "Frame to load the resource from." },
195                { "name": "url", "type": "string", "description": "URL of the resource to load." }
196            ],
197            "returns": [
198                { "name": "content", "type": "string", "description": "Resource content." },
199                { "name": "mimeType", "type": "string", "description": "Resource mimeType." },
200                { "name": "status", "type": "number", "description": "HTTP response status code." }
201            ],
202            "description": "Loads a resource in the context of a frame on the inspected page without cross origin checks."
203        }
204    ],
205    "events": [
206        {
207            "name": "requestWillBeSent",
208            "description": "Fired when page is about to send HTTP request.",
209            "parameters": [
210                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
211                { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
212                { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
213                { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },
214                { "name": "request", "$ref": "Request", "description": "Request data." },
215                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
216                { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },
217                { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." },
218                { "name": "type", "$ref": "Page.ResourceType", "optional": true, "description": "Resource type." }
219            ]
220        },
221        {
222            "name": "requestServedFromCache",
223            "description": "Fired if request ended up loading from cache.",
224            "parameters": [
225                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }
226            ]
227        },
228        {
229            "name": "responseReceived",
230            "description": "Fired when HTTP response is available.",
231            "parameters": [
232                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
233                { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
234                { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
235                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
236                { "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." },
237                { "name": "response", "$ref": "Response", "description": "Response data." }
238            ]
239        },
240        {
241            "name": "dataReceived",
242            "description": "Fired when data chunk was received over the network.",
243            "parameters": [
244                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
245                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
246                { "name": "dataLength", "type": "integer", "description": "Data chunk length." },
247                { "name": "encodedDataLength", "type": "integer", "description": "Actual bytes received (might be less than dataLength for compressed encodings)." }
248            ]
249        },
250        {
251            "name": "loadingFinished",
252            "description": "Fired when HTTP request has finished loading.",
253            "parameters": [
254                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
255                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
256                { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with this resource (if any)." }
257            ]
258        },
259        {
260            "name": "loadingFailed",
261            "description": "Fired when HTTP request has failed to load.",
262            "parameters": [
263                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
264                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
265                { "name": "errorText", "type": "string", "description": "User friendly error message." },
266                { "name": "canceled", "type": "boolean", "optional": true, "description": "True if loading was canceled." }
267            ]
268        },
269        {
270            "name": "requestServedFromMemoryCache",
271            "description": "Fired when HTTP request has been served from memory cache.",
272            "parameters": [
273                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
274                { "name": "frameId", "$ref": "FrameId", "description": "Frame identifier." },
275                { "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
276                { "name": "documentURL", "type": "string", "description": "URL of the document this request is loaded for." },
277                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
278                { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." },
279                { "name": "resource", "$ref": "CachedResource", "description": "Cached resource data." }
280            ]
281        },
282        {
283            "name": "webSocketWillSendHandshakeRequest",
284            "description": "Fired when WebSocket is about to initiate handshake.",
285            "parameters": [
286                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
287                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
288                { "name": "request", "$ref": "WebSocketRequest", "description": "WebSocket request data." }
289            ]
290        },
291        {
292            "name": "webSocketHandshakeResponseReceived",
293            "description": "Fired when WebSocket handshake response becomes available.",
294            "parameters": [
295                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
296                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
297                { "name": "response", "$ref": "WebSocketResponse", "description": "WebSocket response data." }
298            ]
299        },
300        {
301            "name": "webSocketCreated",
302            "description": "Fired upon WebSocket creation.",
303            "parameters": [
304                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
305                { "name": "url", "type": "string", "description": "WebSocket request URL." }
306            ]
307        },
308        {
309            "name": "webSocketClosed",
310            "description": "Fired when WebSocket is closed.",
311            "parameters": [
312                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
313                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }
314            ]
315        },
316        {
317            "name": "webSocketFrameReceived",
318            "description": "Fired when WebSocket frame is received.",
319            "parameters": [
320                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
321                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
322                { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }
323            ]
324        },
325        {
326            "name": "webSocketFrameError",
327            "description": "Fired when WebSocket frame error occurs.",
328            "parameters": [
329                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
330                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
331                { "name": "errorMessage", "type": "string", "description": "WebSocket frame error message." }
332            ]
333        },
334        {
335            "name": "webSocketFrameSent",
336            "description": "Fired when WebSocket frame is sent.",
337            "parameters": [
338                { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
339                { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
340                { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." }
341            ]
342        }
343    ]
344}
345