cdp_driver/methods/network.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Network domain allows tracking network activities of the page. It exposes
5//! information about http, file, data and other requests and responses, their
6//! headers, bodies, timing, etc.
7//!
8//! Method names for the `Network` domain, for use with
9//! [`CdpClient::call`](crate::CdpClient::call).
10
11/// Sets a list of content encodings that will be accepted. Empty list means
12/// no encoding is accepted.
13///
14/// Experimental: may change without notice.
15///
16/// Parameters:
17/// - `encodings`: array
18pub const SET_ACCEPTED_ENCODINGS: &str = "Network.setAcceptedEncodings";
19
20/// Clears accepted encodings set by setAcceptedEncodings
21///
22/// Experimental: may change without notice.
23pub const CLEAR_ACCEPTED_ENCODINGS_OVERRIDE: &str = "Network.clearAcceptedEncodingsOverride";
24
25/// Tells whether clearing browser cache is supported.
26///
27/// Deprecated in the protocol.
28///
29/// Returns: `result`
30pub const CAN_CLEAR_BROWSER_CACHE: &str = "Network.canClearBrowserCache";
31
32/// Tells whether clearing browser cookies is supported.
33///
34/// Deprecated in the protocol.
35///
36/// Returns: `result`
37pub const CAN_CLEAR_BROWSER_COOKIES: &str = "Network.canClearBrowserCookies";
38
39/// Tells whether emulation of network conditions is supported.
40///
41/// Deprecated in the protocol.
42///
43/// Returns: `result`
44pub const CAN_EMULATE_NETWORK_CONDITIONS: &str = "Network.canEmulateNetworkConditions";
45
46/// Clears browser cache.
47pub const CLEAR_BROWSER_CACHE: &str = "Network.clearBrowserCache";
48
49/// Clears browser cookies.
50pub const CLEAR_BROWSER_COOKIES: &str = "Network.clearBrowserCookies";
51
52/// Deletes browser cookies with matching name and url or
53/// domain/path/partitionKey pair.
54///
55/// Parameters:
56/// - `name`: string
57/// - `url`: string (optional)
58/// - `domain`: string (optional)
59/// - `path`: string (optional)
60/// - `partitionKey`: CookiePartitionKey (optional)
61pub const DELETE_COOKIES: &str = "Network.deleteCookies";
62
63/// Disables network tracking, prevents network events from being sent to the
64/// client.
65pub const DISABLE: &str = "Network.disable";
66
67/// Activates emulation of network conditions. This command is deprecated in
68/// favor of the emulateNetworkConditionsByRule and overrideNetworkState
69/// commands, which can be used together to the same effect.
70///
71/// Deprecated in the protocol.
72///
73/// Parameters:
74/// - `offline`: boolean
75/// - `latency`: number
76/// - `downloadThroughput`: number
77/// - `uploadThroughput`: number
78/// - `connectionType`: ConnectionType (optional)
79/// - `packetLoss`: number (optional)
80/// - `packetQueueLength`: integer (optional)
81/// - `packetReordering`: boolean (optional)
82pub const EMULATE_NETWORK_CONDITIONS: &str = "Network.emulateNetworkConditions";
83
84/// Activates emulation of network conditions for individual requests using
85/// URL match patterns. Unlike the deprecated Network.emulateNetworkConditions
86/// this method does not affect `navigator` state. Use
87/// Network.overrideNetworkState to explicitly modify `navigator` behavior.
88///
89/// Experimental: may change without notice.
90///
91/// Parameters:
92/// - `offline`: boolean (optional)
93/// - `emulateOfflineServiceWorker`: boolean (optional)
94/// - `matchedNetworkConditions`: array
95///
96/// Returns: `ruleIds`
97pub const EMULATE_NETWORK_CONDITIONS_BY_RULE: &str = "Network.emulateNetworkConditionsByRule";
98
99/// Override the state of navigator.onLine and navigator.connection.
100///
101/// Experimental: may change without notice.
102///
103/// Parameters:
104/// - `offline`: boolean
105/// - `latency`: number
106/// - `downloadThroughput`: number
107/// - `uploadThroughput`: number
108/// - `connectionType`: ConnectionType (optional)
109pub const OVERRIDE_NETWORK_STATE: &str = "Network.overrideNetworkState";
110
111/// Enables network tracking, network events will now be delivered to the
112/// client.
113///
114/// Parameters:
115/// - `maxTotalBufferSize`: integer (optional)
116/// - `maxResourceBufferSize`: integer (optional)
117/// - `maxPostDataSize`: integer (optional)
118/// - `reportDirectSocketTraffic`: boolean (optional)
119/// - `enableDurableMessages`: boolean (optional)
120pub const ENABLE: &str = "Network.enable";
121
122/// Configures storing response bodies outside of renderer, so that these
123/// survive a cross-process navigation. If maxTotalBufferSize is not set,
124/// durable messages are disabled.
125///
126/// Experimental: may change without notice.
127///
128/// Parameters:
129/// - `maxTotalBufferSize`: integer (optional)
130/// - `maxResourceBufferSize`: integer (optional)
131pub const CONFIGURE_DURABLE_MESSAGES: &str = "Network.configureDurableMessages";
132
133/// Returns all browser cookies. Depending on the backend support, will return
134/// detailed cookie information in the `cookies` field. Deprecated. Use
135/// Storage.getCookies instead.
136///
137/// Deprecated in the protocol.
138///
139/// Returns: `cookies`
140pub const GET_ALL_COOKIES: &str = "Network.getAllCookies";
141
142/// Returns the DER-encoded certificate.
143///
144/// Experimental: may change without notice.
145///
146/// Parameters:
147/// - `origin`: string
148///
149/// Returns: `tableNames`
150pub const GET_CERTIFICATE: &str = "Network.getCertificate";
151
152/// Returns all browser cookies for the current URL. Depending on the backend
153/// support, will return detailed cookie information in the `cookies` field.
154///
155/// Parameters:
156/// - `urls`: array (optional)
157///
158/// Returns: `cookies`
159pub const GET_COOKIES: &str = "Network.getCookies";
160
161/// Returns content served for the given request.
162///
163/// Parameters:
164/// - `requestId`: RequestId
165///
166/// Returns: `body`, `base64Encoded`
167pub const GET_RESPONSE_BODY: &str = "Network.getResponseBody";
168
169/// Returns post data sent with the request. Returns an error when no data was
170/// sent with the request.
171///
172/// Parameters:
173/// - `requestId`: RequestId
174///
175/// Returns: `postData`, `base64Encoded`
176pub const GET_REQUEST_POST_DATA: &str = "Network.getRequestPostData";
177
178/// This method sends a new XMLHttpRequest which is identical to the original
179/// one. The following parameters should be identical: method, url, async,
180/// request body, extra headers, withCredentials attribute, user, password.
181///
182/// Experimental: may change without notice.
183///
184/// Parameters:
185/// - `requestId`: RequestId
186pub const REPLAY_XHR: &str = "Network.replayXHR";
187
188/// Searches for given string in response content.
189///
190/// Experimental: may change without notice.
191///
192/// Parameters:
193/// - `requestId`: RequestId
194/// - `query`: string
195/// - `caseSensitive`: boolean (optional)
196/// - `isRegex`: boolean (optional)
197///
198/// Returns: `result`
199pub const SEARCH_IN_RESPONSE_BODY: &str = "Network.searchInResponseBody";
200
201/// Blocks URLs from loading.
202///
203/// Experimental: may change without notice.
204///
205/// Parameters:
206/// - `urlPatterns`: array (optional)
207/// - `urls`: array (optional)
208pub const SET_BLOCKED_UR_LS: &str = "Network.setBlockedURLs";
209
210/// Toggles ignoring of service worker for each request.
211///
212/// Parameters:
213/// - `bypass`: boolean
214pub const SET_BYPASS_SERVICE_WORKER: &str = "Network.setBypassServiceWorker";
215
216/// Toggles ignoring cache for each request. If `true`, cache will not be
217/// used.
218///
219/// Parameters:
220/// - `cacheDisabled`: boolean
221pub const SET_CACHE_DISABLED: &str = "Network.setCacheDisabled";
222
223/// Sets a cookie with the given cookie data; may overwrite equivalent cookies
224/// if they exist.
225///
226/// Parameters:
227/// - `name`: string
228/// - `value`: string
229/// - `url`: string (optional)
230/// - `domain`: string (optional)
231/// - `path`: string (optional)
232/// - `secure`: boolean (optional)
233/// - `httpOnly`: boolean (optional)
234/// - `sameSite`: CookieSameSite (optional)
235/// - `expires`: TimeSinceEpoch (optional)
236/// - `priority`: CookiePriority (optional)
237/// - `sourceScheme`: CookieSourceScheme (optional)
238/// - `sourcePort`: integer (optional)
239/// - `partitionKey`: CookiePartitionKey (optional)
240///
241/// Returns: `success`
242pub const SET_COOKIE: &str = "Network.setCookie";
243
244/// Sets given cookies.
245///
246/// Parameters:
247/// - `cookies`: array
248pub const SET_COOKIES: &str = "Network.setCookies";
249
250/// Specifies whether to always send extra HTTP headers with the requests from
251/// this page.
252///
253/// Parameters:
254/// - `headers`: Headers
255pub const SET_EXTRA_HTTP_HEADERS: &str = "Network.setExtraHTTPHeaders";
256
257/// Specifies whether to attach a page script stack id in requests
258///
259/// Experimental: may change without notice.
260///
261/// Parameters:
262/// - `enabled`: boolean
263pub const SET_ATTACH_DEBUG_STACK: &str = "Network.setAttachDebugStack";
264
265/// Allows overriding user agent with the given string.
266///
267/// Parameters:
268/// - `userAgent`: string
269/// - `acceptLanguage`: string (optional)
270/// - `platform`: string (optional)
271/// - `userAgentMetadata`: Emulation.UserAgentMetadata (optional)
272pub const SET_USER_AGENT_OVERRIDE: &str = "Network.setUserAgentOverride";
273
274/// Enables streaming of the response for the given requestId. If enabled, the
275/// dataReceived event contains the data that was received during streaming.
276///
277/// Experimental: may change without notice.
278///
279/// Parameters:
280/// - `requestId`: RequestId
281///
282/// Returns: `bufferedData`
283pub const STREAM_RESOURCE_CONTENT: &str = "Network.streamResourceContent";
284
285/// Returns information about the COEP/COOP isolation status.
286///
287/// Experimental: may change without notice.
288///
289/// Parameters:
290/// - `frameId`: Page.FrameId (optional)
291///
292/// Returns: `status`
293pub const GET_SECURITY_ISOLATION_STATUS: &str = "Network.getSecurityIsolationStatus";
294
295/// Enables tracking for the Reporting API, events generated by the Reporting
296/// API will now be delivered to the client. Enabling triggers
297/// 'reportingApiReportAdded' for all existing reports.
298///
299/// Experimental: may change without notice.
300///
301/// Parameters:
302/// - `enable`: boolean
303pub const ENABLE_REPORTING_API: &str = "Network.enableReportingApi";
304
305/// Sets up tracking device bound sessions and fetching of initial set of
306/// sessions.
307///
308/// Experimental: may change without notice.
309///
310/// Parameters:
311/// - `enable`: boolean
312pub const ENABLE_DEVICE_BOUND_SESSIONS: &str = "Network.enableDeviceBoundSessions";
313
314/// Deletes a device bound session.
315///
316/// Experimental: may change without notice.
317///
318/// Parameters:
319/// - `key`: DeviceBoundSessionKey
320pub const DELETE_DEVICE_BOUND_SESSION: &str = "Network.deleteDeviceBoundSession";
321
322/// Fetches the schemeful site for a specific origin.
323///
324/// Experimental: may change without notice.
325///
326/// Parameters:
327/// - `origin`: string
328///
329/// Returns: `schemefulSite`
330pub const FETCH_SCHEMEFUL_SITE: &str = "Network.fetchSchemefulSite";
331
332/// Fetches the resource and returns the content.
333///
334/// Experimental: may change without notice.
335///
336/// Parameters:
337/// - `frameId`: Page.FrameId (optional)
338/// - `url`: string
339/// - `options`: LoadNetworkResourceOptions
340///
341/// Returns: `resource`
342pub const LOAD_NETWORK_RESOURCE: &str = "Network.loadNetworkResource";
343
344/// Sets Controls for third-party cookie access Page reload is required before
345/// the new cookie behavior will be observed
346///
347/// Experimental: may change without notice.
348///
349/// Parameters:
350/// - `enableThirdPartyCookieRestriction`: boolean
351pub const SET_COOKIE_CONTROLS: &str = "Network.setCookieControls";