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
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! 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.
//!
//! Method names for the `Network` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).
/// Sets a list of content encodings that will be accepted. Empty list means
/// no encoding is accepted.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `encodings`: array
pub const SET_ACCEPTED_ENCODINGS: &str = "Network.setAcceptedEncodings";
/// Clears accepted encodings set by setAcceptedEncodings
///
/// Experimental: may change without notice.
pub const CLEAR_ACCEPTED_ENCODINGS_OVERRIDE: &str = "Network.clearAcceptedEncodingsOverride";
/// Tells whether clearing browser cache is supported.
///
/// Deprecated in the protocol.
///
/// Returns: `result`
pub const CAN_CLEAR_BROWSER_CACHE: &str = "Network.canClearBrowserCache";
/// Tells whether clearing browser cookies is supported.
///
/// Deprecated in the protocol.
///
/// Returns: `result`
pub const CAN_CLEAR_BROWSER_COOKIES: &str = "Network.canClearBrowserCookies";
/// Tells whether emulation of network conditions is supported.
///
/// Deprecated in the protocol.
///
/// Returns: `result`
pub const CAN_EMULATE_NETWORK_CONDITIONS: &str = "Network.canEmulateNetworkConditions";
/// Clears browser cache.
pub const CLEAR_BROWSER_CACHE: &str = "Network.clearBrowserCache";
/// Clears browser cookies.
pub const CLEAR_BROWSER_COOKIES: &str = "Network.clearBrowserCookies";
/// Deletes browser cookies with matching name and url or
/// domain/path/partitionKey pair.
///
/// Parameters:
/// - `name`: string
/// - `url`: string (optional)
/// - `domain`: string (optional)
/// - `path`: string (optional)
/// - `partitionKey`: CookiePartitionKey (optional)
pub const DELETE_COOKIES: &str = "Network.deleteCookies";
/// Disables network tracking, prevents network events from being sent to the
/// client.
pub const DISABLE: &str = "Network.disable";
/// Activates emulation of network conditions. This command is deprecated in
/// favor of the emulateNetworkConditionsByRule and overrideNetworkState
/// commands, which can be used together to the same effect.
///
/// Deprecated in the protocol.
///
/// Parameters:
/// - `offline`: boolean
/// - `latency`: number
/// - `downloadThroughput`: number
/// - `uploadThroughput`: number
/// - `connectionType`: ConnectionType (optional)
/// - `packetLoss`: number (optional)
/// - `packetQueueLength`: integer (optional)
/// - `packetReordering`: boolean (optional)
pub const EMULATE_NETWORK_CONDITIONS: &str = "Network.emulateNetworkConditions";
/// Activates emulation of network conditions for individual requests using
/// URL match patterns. Unlike the deprecated Network.emulateNetworkConditions
/// this method does not affect `navigator` state. Use
/// Network.overrideNetworkState to explicitly modify `navigator` behavior.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `offline`: boolean (optional)
/// - `emulateOfflineServiceWorker`: boolean (optional)
/// - `matchedNetworkConditions`: array
///
/// Returns: `ruleIds`
pub const EMULATE_NETWORK_CONDITIONS_BY_RULE: &str = "Network.emulateNetworkConditionsByRule";
/// Override the state of navigator.onLine and navigator.connection.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `offline`: boolean
/// - `latency`: number
/// - `downloadThroughput`: number
/// - `uploadThroughput`: number
/// - `connectionType`: ConnectionType (optional)
pub const OVERRIDE_NETWORK_STATE: &str = "Network.overrideNetworkState";
/// Enables network tracking, network events will now be delivered to the
/// client.
///
/// Parameters:
/// - `maxTotalBufferSize`: integer (optional)
/// - `maxResourceBufferSize`: integer (optional)
/// - `maxPostDataSize`: integer (optional)
/// - `reportDirectSocketTraffic`: boolean (optional)
/// - `enableDurableMessages`: boolean (optional)
pub const ENABLE: &str = "Network.enable";
/// Configures storing response bodies outside of renderer, so that these
/// survive a cross-process navigation. If maxTotalBufferSize is not set,
/// durable messages are disabled.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `maxTotalBufferSize`: integer (optional)
/// - `maxResourceBufferSize`: integer (optional)
pub const CONFIGURE_DURABLE_MESSAGES: &str = "Network.configureDurableMessages";
/// Returns all browser cookies. Depending on the backend support, will return
/// detailed cookie information in the `cookies` field. Deprecated. Use
/// Storage.getCookies instead.
///
/// Deprecated in the protocol.
///
/// Returns: `cookies`
pub const GET_ALL_COOKIES: &str = "Network.getAllCookies";
/// Returns the DER-encoded certificate.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `origin`: string
///
/// Returns: `tableNames`
pub const GET_CERTIFICATE: &str = "Network.getCertificate";
/// Returns all browser cookies for the current URL. Depending on the backend
/// support, will return detailed cookie information in the `cookies` field.
///
/// Parameters:
/// - `urls`: array (optional)
///
/// Returns: `cookies`
pub const GET_COOKIES: &str = "Network.getCookies";
/// Returns content served for the given request.
///
/// Parameters:
/// - `requestId`: RequestId
///
/// Returns: `body`, `base64Encoded`
pub const GET_RESPONSE_BODY: &str = "Network.getResponseBody";
/// Returns post data sent with the request. Returns an error when no data was
/// sent with the request.
///
/// Parameters:
/// - `requestId`: RequestId
///
/// Returns: `postData`, `base64Encoded`
pub const GET_REQUEST_POST_DATA: &str = "Network.getRequestPostData";
/// 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.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `requestId`: RequestId
pub const REPLAY_XHR: &str = "Network.replayXHR";
/// Searches for given string in response content.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `requestId`: RequestId
/// - `query`: string
/// - `caseSensitive`: boolean (optional)
/// - `isRegex`: boolean (optional)
///
/// Returns: `result`
pub const SEARCH_IN_RESPONSE_BODY: &str = "Network.searchInResponseBody";
/// Blocks URLs from loading.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `urlPatterns`: array (optional)
/// - `urls`: array (optional)
pub const SET_BLOCKED_UR_LS: &str = "Network.setBlockedURLs";
/// Toggles ignoring of service worker for each request.
///
/// Parameters:
/// - `bypass`: boolean
pub const SET_BYPASS_SERVICE_WORKER: &str = "Network.setBypassServiceWorker";
/// Toggles ignoring cache for each request. If `true`, cache will not be
/// used.
///
/// Parameters:
/// - `cacheDisabled`: boolean
pub const SET_CACHE_DISABLED: &str = "Network.setCacheDisabled";
/// Sets a cookie with the given cookie data; may overwrite equivalent cookies
/// if they exist.
///
/// Parameters:
/// - `name`: string
/// - `value`: string
/// - `url`: string (optional)
/// - `domain`: string (optional)
/// - `path`: string (optional)
/// - `secure`: boolean (optional)
/// - `httpOnly`: boolean (optional)
/// - `sameSite`: CookieSameSite (optional)
/// - `expires`: TimeSinceEpoch (optional)
/// - `priority`: CookiePriority (optional)
/// - `sourceScheme`: CookieSourceScheme (optional)
/// - `sourcePort`: integer (optional)
/// - `partitionKey`: CookiePartitionKey (optional)
///
/// Returns: `success`
pub const SET_COOKIE: &str = "Network.setCookie";
/// Sets given cookies.
///
/// Parameters:
/// - `cookies`: array
pub const SET_COOKIES: &str = "Network.setCookies";
/// Specifies whether to always send extra HTTP headers with the requests from
/// this page.
///
/// Parameters:
/// - `headers`: Headers
pub const SET_EXTRA_HTTP_HEADERS: &str = "Network.setExtraHTTPHeaders";
/// Specifies whether to attach a page script stack id in requests
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enabled`: boolean
pub const SET_ATTACH_DEBUG_STACK: &str = "Network.setAttachDebugStack";
/// Allows overriding user agent with the given string.
///
/// Parameters:
/// - `userAgent`: string
/// - `acceptLanguage`: string (optional)
/// - `platform`: string (optional)
/// - `userAgentMetadata`: Emulation.UserAgentMetadata (optional)
pub const SET_USER_AGENT_OVERRIDE: &str = "Network.setUserAgentOverride";
/// Enables streaming of the response for the given requestId. If enabled, the
/// dataReceived event contains the data that was received during streaming.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `requestId`: RequestId
///
/// Returns: `bufferedData`
pub const STREAM_RESOURCE_CONTENT: &str = "Network.streamResourceContent";
/// Returns information about the COEP/COOP isolation status.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `frameId`: Page.FrameId (optional)
///
/// Returns: `status`
pub const GET_SECURITY_ISOLATION_STATUS: &str = "Network.getSecurityIsolationStatus";
/// Enables tracking for the Reporting API, events generated by the Reporting
/// API will now be delivered to the client. Enabling triggers
/// 'reportingApiReportAdded' for all existing reports.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enable`: boolean
pub const ENABLE_REPORTING_API: &str = "Network.enableReportingApi";
/// Sets up tracking device bound sessions and fetching of initial set of
/// sessions.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enable`: boolean
pub const ENABLE_DEVICE_BOUND_SESSIONS: &str = "Network.enableDeviceBoundSessions";
/// Deletes a device bound session.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `key`: DeviceBoundSessionKey
pub const DELETE_DEVICE_BOUND_SESSION: &str = "Network.deleteDeviceBoundSession";
/// Fetches the schemeful site for a specific origin.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `origin`: string
///
/// Returns: `schemefulSite`
pub const FETCH_SCHEMEFUL_SITE: &str = "Network.fetchSchemefulSite";
/// Fetches the resource and returns the content.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `frameId`: Page.FrameId (optional)
/// - `url`: string
/// - `options`: LoadNetworkResourceOptions
///
/// Returns: `resource`
pub const LOAD_NETWORK_RESOURCE: &str = "Network.loadNetworkResource";
/// Sets Controls for third-party cookie access Page reload is required before
/// the new cookie behavior will be observed
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enableThirdPartyCookieRestriction`: boolean
pub const SET_COOKIE_CONTROLS: &str = "Network.setCookieControls";