cdp-driver 0.3.0

Chrome DevTools Protocol client for AI agent browser control
Documentation
// @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";