pub struct NetworkClient { /* private fields */ }Expand description
Client for Network domain commands.
Implementations§
Source§impl NetworkClient
impl NetworkClient
Sourcepub async fn set_accepted_encodings(
&self,
params: SetAcceptedEncodingsParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_accepted_encodings( &self, params: SetAcceptedEncodingsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
Sourcepub async fn clear_accepted_encodings_override(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn clear_accepted_encodings_override( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Clears accepted encodings set by setAcceptedEncodings
Sourcepub async fn can_clear_browser_cache(
&self,
session_id: Option<&str>,
) -> Result<CanClearBrowserCacheReturns, CdpError>
pub async fn can_clear_browser_cache( &self, session_id: Option<&str>, ) -> Result<CanClearBrowserCacheReturns, CdpError>
Tells whether clearing browser cache is supported.
Tells whether clearing browser cookies is supported.
Sourcepub async fn can_emulate_network_conditions(
&self,
session_id: Option<&str>,
) -> Result<CanEmulateNetworkConditionsReturns, CdpError>
pub async fn can_emulate_network_conditions( &self, session_id: Option<&str>, ) -> Result<CanEmulateNetworkConditionsReturns, CdpError>
Tells whether emulation of network conditions is supported.
Sourcepub async fn clear_browser_cache(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn clear_browser_cache( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Clears browser cache.
Clears browser cookies.
Sourcepub async fn continue_intercepted_request(
&self,
params: ContinueInterceptedRequestParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn continue_intercepted_request( &self, params: ContinueInterceptedRequestParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.
Sourcepub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Disables network tracking, prevents network events from being sent to the client.
Sourcepub async fn emulate_network_conditions(
&self,
params: EmulateNetworkConditionsParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn emulate_network_conditions( &self, params: EmulateNetworkConditionsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn emulate_network_conditions_by_rule(
&self,
params: EmulateNetworkConditionsByRuleParams,
session_id: Option<&str>,
) -> Result<EmulateNetworkConditionsByRuleReturns, CdpError>
pub async fn emulate_network_conditions_by_rule( &self, params: EmulateNetworkConditionsByRuleParams, session_id: Option<&str>, ) -> Result<EmulateNetworkConditionsByRuleReturns, CdpError>
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.
Sourcepub async fn override_network_state(
&self,
params: OverrideNetworkStateParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn override_network_state( &self, params: OverrideNetworkStateParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Override the state of navigator.onLine and navigator.connection.
Sourcepub async fn enable(
&self,
params: EnableParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn enable( &self, params: EnableParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Enables network tracking, network events will now be delivered to the client.
Returns all browser cookies. Depending on the backend support, will return detailed cookie
information in the cookies field.
Deprecated. Use Storage.getCookies instead.
Sourcepub async fn get_certificate(
&self,
params: GetCertificateParams,
session_id: Option<&str>,
) -> Result<GetCertificateReturns, CdpError>
pub async fn get_certificate( &self, params: GetCertificateParams, session_id: Option<&str>, ) -> Result<GetCertificateReturns, CdpError>
Returns the DER-encoded certificate.
Returns all browser cookies for the current URL. Depending on the backend support, will return
detailed cookie information in the cookies field.
Sourcepub async fn get_response_body(
&self,
params: GetResponseBodyParams,
session_id: Option<&str>,
) -> Result<GetResponseBodyReturns, CdpError>
pub async fn get_response_body( &self, params: GetResponseBodyParams, session_id: Option<&str>, ) -> Result<GetResponseBodyReturns, CdpError>
Returns content served for the given request.
Sourcepub async fn get_request_post_data(
&self,
params: GetRequestPostDataParams,
session_id: Option<&str>,
) -> Result<GetRequestPostDataReturns, CdpError>
pub async fn get_request_post_data( &self, params: GetRequestPostDataParams, session_id: Option<&str>, ) -> Result<GetRequestPostDataReturns, CdpError>
Returns post data sent with the request. Returns an error when no data was sent with the request.
Sourcepub async fn get_response_body_for_interception(
&self,
params: GetResponseBodyForInterceptionParams,
session_id: Option<&str>,
) -> Result<GetResponseBodyForInterceptionReturns, CdpError>
pub async fn get_response_body_for_interception( &self, params: GetResponseBodyForInterceptionParams, session_id: Option<&str>, ) -> Result<GetResponseBodyForInterceptionReturns, CdpError>
Returns content served for the given currently intercepted request.
Sourcepub async fn take_response_body_for_interception_as_stream(
&self,
params: TakeResponseBodyForInterceptionAsStreamParams,
session_id: Option<&str>,
) -> Result<TakeResponseBodyForInterceptionAsStreamReturns, CdpError>
pub async fn take_response_body_for_interception_as_stream( &self, params: TakeResponseBodyForInterceptionAsStreamParams, session_id: Option<&str>, ) -> Result<TakeResponseBodyForInterceptionAsStreamReturns, CdpError>
Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can’t be continued as is – you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.
Sourcepub async fn replay_xhr(
&self,
params: ReplayXhrParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn replay_xhr( &self, params: ReplayXhrParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn search_in_response_body(
&self,
params: SearchInResponseBodyParams,
session_id: Option<&str>,
) -> Result<SearchInResponseBodyReturns, CdpError>
pub async fn search_in_response_body( &self, params: SearchInResponseBodyParams, session_id: Option<&str>, ) -> Result<SearchInResponseBodyReturns, CdpError>
Searches for given string in response content.
Sourcepub async fn set_blocked_ur_ls(
&self,
params: SetBlockedUrLsParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_blocked_ur_ls( &self, params: SetBlockedUrLsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Blocks URLs from loading.
Sourcepub async fn set_bypass_service_worker(
&self,
params: SetBypassServiceWorkerParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_bypass_service_worker( &self, params: SetBypassServiceWorkerParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Toggles ignoring of service worker for each request.
Sourcepub async fn set_cache_disabled(
&self,
params: SetCacheDisabledParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_cache_disabled( &self, params: SetCacheDisabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Toggles ignoring cache for each request. If true, cache will not be used.
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
Sets given cookies.
Sourcepub async fn set_extra_http_headers(
&self,
params: SetExtraHttpHeadersParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_extra_http_headers( &self, params: SetExtraHttpHeadersParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Specifies whether to always send extra HTTP headers with the requests from this page.
Sourcepub async fn set_attach_debug_stack(
&self,
params: SetAttachDebugStackParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_attach_debug_stack( &self, params: SetAttachDebugStackParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Specifies whether to attach a page script stack id in requests
Sourcepub async fn set_request_interception(
&self,
params: SetRequestInterceptionParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_request_interception( &self, params: SetRequestInterceptionParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
Sourcepub async fn set_user_agent_override(
&self,
params: SetUserAgentOverrideParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_user_agent_override( &self, params: SetUserAgentOverrideParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Allows overriding user agent with the given string.
Sourcepub async fn stream_resource_content(
&self,
params: StreamResourceContentParams,
session_id: Option<&str>,
) -> Result<StreamResourceContentReturns, CdpError>
pub async fn stream_resource_content( &self, params: StreamResourceContentParams, session_id: Option<&str>, ) -> Result<StreamResourceContentReturns, CdpError>
Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.
Sourcepub async fn get_security_isolation_status(
&self,
params: GetSecurityIsolationStatusParams,
session_id: Option<&str>,
) -> Result<GetSecurityIsolationStatusReturns, CdpError>
pub async fn get_security_isolation_status( &self, params: GetSecurityIsolationStatusParams, session_id: Option<&str>, ) -> Result<GetSecurityIsolationStatusReturns, CdpError>
Returns information about the COEP/COOP isolation status.
Sourcepub async fn enable_reporting_api(
&self,
params: EnableReportingApiParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn enable_reporting_api( &self, params: EnableReportingApiParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn load_network_resource(
&self,
params: LoadNetworkResourceParams,
session_id: Option<&str>,
) -> Result<LoadNetworkResourceReturns, CdpError>
pub async fn load_network_resource( &self, params: LoadNetworkResourceParams, session_id: Option<&str>, ) -> Result<LoadNetworkResourceReturns, CdpError>
Fetches the resource and returns the content.
Sets Controls for third-party cookie access Page reload is required before the new cookie behavior will be observed