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