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