Table of Contents

Class NetworkAdapter

Namespace
OpenQA.Selenium.DevTools.V147.Network
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Network domain to simplify the command interface.

public class NetworkAdapter
Inheritance
NetworkAdapter
Inherited Members

Constructors

NetworkAdapter(IDevToolsSession)

Initializes a new instance of the NetworkAdapter class.

public NetworkAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

CanClearBrowserCache(CanClearBrowserCacheCommandSettings?, CancellationToken, int?, bool)

Tells whether clearing browser cache is supported.

public Task<CanClearBrowserCacheCommandResponse> CanClearBrowserCache(CanClearBrowserCacheCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CanClearBrowserCacheCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CanClearBrowserCacheCommandResponse>

CanClearBrowserCookies(CanClearBrowserCookiesCommandSettings?, CancellationToken, int?, bool)

Tells whether clearing browser cookies is supported.

public Task<CanClearBrowserCookiesCommandResponse> CanClearBrowserCookies(CanClearBrowserCookiesCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CanClearBrowserCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CanClearBrowserCookiesCommandResponse>

CanEmulateNetworkConditions(CanEmulateNetworkConditionsCommandSettings?, CancellationToken, int?, bool)

Tells whether emulation of network conditions is supported.

public Task<CanEmulateNetworkConditionsCommandResponse> CanEmulateNetworkConditions(CanEmulateNetworkConditionsCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CanEmulateNetworkConditionsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CanEmulateNetworkConditionsCommandResponse>

ClearAcceptedEncodingsOverride(ClearAcceptedEncodingsOverrideCommandSettings?, CancellationToken, int?, bool)

Clears accepted encodings set by setAcceptedEncodings

public Task<ClearAcceptedEncodingsOverrideCommandResponse?> ClearAcceptedEncodingsOverride(ClearAcceptedEncodingsOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearAcceptedEncodingsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearAcceptedEncodingsOverrideCommandResponse>

ClearBrowserCache(ClearBrowserCacheCommandSettings?, CancellationToken, int?, bool)

Clears browser cache.

public Task<ClearBrowserCacheCommandResponse?> ClearBrowserCache(ClearBrowserCacheCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearBrowserCacheCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearBrowserCacheCommandResponse>

ClearBrowserCookies(ClearBrowserCookiesCommandSettings?, CancellationToken, int?, bool)

Clears browser cookies.

public Task<ClearBrowserCookiesCommandResponse?> ClearBrowserCookies(ClearBrowserCookiesCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearBrowserCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearBrowserCookiesCommandResponse>

ConfigureDurableMessages(ConfigureDurableMessagesCommandSettings, CancellationToken, int?, bool)

Configures storing response bodies outside of renderer, so that these survive a cross-process navigation. If maxTotalBufferSize is not set, durable messages are disabled.

public Task<ConfigureDurableMessagesCommandResponse?> ConfigureDurableMessages(ConfigureDurableMessagesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ConfigureDurableMessagesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ConfigureDurableMessagesCommandResponse>

ContinueInterceptedRequest(ContinueInterceptedRequestCommandSettings, CancellationToken, int?, bool)

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.

public Task<ContinueInterceptedRequestCommandResponse?> ContinueInterceptedRequest(ContinueInterceptedRequestCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ContinueInterceptedRequestCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ContinueInterceptedRequestCommandResponse>

DeleteCookies(DeleteCookiesCommandSettings, CancellationToken, int?, bool)

Deletes browser cookies with matching name and url or domain/path/partitionKey pair.

public Task<DeleteCookiesCommandResponse?> DeleteCookies(DeleteCookiesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DeleteCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DeleteCookiesCommandResponse>

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disables network tracking, prevents network events from being sent to the client.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

EmulateNetworkConditions(EmulateNetworkConditionsCommandSettings, CancellationToken, int?, bool)

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.

public Task<EmulateNetworkConditionsCommandResponse?> EmulateNetworkConditions(EmulateNetworkConditionsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EmulateNetworkConditionsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EmulateNetworkConditionsCommandResponse>

EmulateNetworkConditionsByRule(EmulateNetworkConditionsByRuleCommandSettings, CancellationToken, int?, bool)

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.

public Task<EmulateNetworkConditionsByRuleCommandResponse> EmulateNetworkConditionsByRule(EmulateNetworkConditionsByRuleCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EmulateNetworkConditionsByRuleCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EmulateNetworkConditionsByRuleCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

Enables network tracking, network events will now be delivered to the client.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

EnableDeviceBoundSessions(EnableDeviceBoundSessionsCommandSettings, CancellationToken, int?, bool)

Sets up tracking device bound sessions and fetching of initial set of sessions.

public Task<EnableDeviceBoundSessionsCommandResponse?> EnableDeviceBoundSessions(EnableDeviceBoundSessionsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableDeviceBoundSessionsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableDeviceBoundSessionsCommandResponse>

EnableReportingApi(EnableReportingApiCommandSettings, CancellationToken, int?, bool)

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.

public Task<EnableReportingApiCommandResponse?> EnableReportingApi(EnableReportingApiCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableReportingApiCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableReportingApiCommandResponse>

FetchSchemefulSite(FetchSchemefulSiteCommandSettings, CancellationToken, int?, bool)

Fetches the schemeful site for a specific origin.

public Task<FetchSchemefulSiteCommandResponse> FetchSchemefulSite(FetchSchemefulSiteCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command FetchSchemefulSiteCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<FetchSchemefulSiteCommandResponse>

GetAllCookies(GetAllCookiesCommandSettings?, CancellationToken, int?, bool)

Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field. Deprecated. Use Storage.getCookies instead.

public Task<GetAllCookiesCommandResponse> GetAllCookies(GetAllCookiesCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAllCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAllCookiesCommandResponse>

GetCertificate(GetCertificateCommandSettings, CancellationToken, int?, bool)

Returns the DER-encoded certificate.

public Task<GetCertificateCommandResponse> GetCertificate(GetCertificateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetCertificateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetCertificateCommandResponse>

GetCookies(GetCookiesCommandSettings, CancellationToken, int?, bool)

Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the cookies field.

public Task<GetCookiesCommandResponse> GetCookies(GetCookiesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetCookiesCommandResponse>

GetRequestPostData(GetRequestPostDataCommandSettings, CancellationToken, int?, bool)

Returns post data sent with the request. Returns an error when no data was sent with the request.

public Task<GetRequestPostDataCommandResponse> GetRequestPostData(GetRequestPostDataCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetRequestPostDataCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetRequestPostDataCommandResponse>

GetResponseBody(GetResponseBodyCommandSettings, CancellationToken, int?, bool)

Returns content served for the given request.

public Task<GetResponseBodyCommandResponse> GetResponseBody(GetResponseBodyCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetResponseBodyCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetResponseBodyCommandResponse>

GetResponseBodyForInterception(GetResponseBodyForInterceptionCommandSettings, CancellationToken, int?, bool)

Returns content served for the given currently intercepted request.

public Task<GetResponseBodyForInterceptionCommandResponse> GetResponseBodyForInterception(GetResponseBodyForInterceptionCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetResponseBodyForInterceptionCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetResponseBodyForInterceptionCommandResponse>

GetSecurityIsolationStatus(GetSecurityIsolationStatusCommandSettings, CancellationToken, int?, bool)

Returns information about the COEP/COOP isolation status.

public Task<GetSecurityIsolationStatusCommandResponse> GetSecurityIsolationStatus(GetSecurityIsolationStatusCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetSecurityIsolationStatusCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetSecurityIsolationStatusCommandResponse>

LoadNetworkResource(LoadNetworkResourceCommandSettings, CancellationToken, int?, bool)

Fetches the resource and returns the content.

public Task<LoadNetworkResourceCommandResponse> LoadNetworkResource(LoadNetworkResourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command LoadNetworkResourceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<LoadNetworkResourceCommandResponse>

OverrideNetworkState(OverrideNetworkStateCommandSettings, CancellationToken, int?, bool)

Override the state of navigator.onLine and navigator.connection.

public Task<OverrideNetworkStateCommandResponse?> OverrideNetworkState(OverrideNetworkStateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command OverrideNetworkStateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<OverrideNetworkStateCommandResponse>

ReplayXHR(ReplayXHRCommandSettings, CancellationToken, int?, bool)

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.

public Task<ReplayXHRCommandResponse?> ReplayXHR(ReplayXHRCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ReplayXHRCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ReplayXHRCommandResponse>

SearchInResponseBody(SearchInResponseBodyCommandSettings, CancellationToken, int?, bool)

Searches for given string in response content.

public Task<SearchInResponseBodyCommandResponse> SearchInResponseBody(SearchInResponseBodyCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SearchInResponseBodyCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SearchInResponseBodyCommandResponse>

SetAcceptedEncodings(SetAcceptedEncodingsCommandSettings, CancellationToken, int?, bool)

Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.

public Task<SetAcceptedEncodingsCommandResponse?> SetAcceptedEncodings(SetAcceptedEncodingsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAcceptedEncodingsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAcceptedEncodingsCommandResponse>

SetAttachDebugStack(SetAttachDebugStackCommandSettings, CancellationToken, int?, bool)

Specifies whether to attach a page script stack id in requests

public Task<SetAttachDebugStackCommandResponse?> SetAttachDebugStack(SetAttachDebugStackCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAttachDebugStackCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAttachDebugStackCommandResponse>

SetBlockedURLs(SetBlockedURLsCommandSettings, CancellationToken, int?, bool)

Blocks URLs from loading.

public Task<SetBlockedURLsCommandResponse?> SetBlockedURLs(SetBlockedURLsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBlockedURLsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBlockedURLsCommandResponse>

SetBypassServiceWorker(SetBypassServiceWorkerCommandSettings, CancellationToken, int?, bool)

Toggles ignoring of service worker for each request.

public Task<SetBypassServiceWorkerCommandResponse?> SetBypassServiceWorker(SetBypassServiceWorkerCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBypassServiceWorkerCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBypassServiceWorkerCommandResponse>

SetCacheDisabled(SetCacheDisabledCommandSettings, CancellationToken, int?, bool)

Toggles ignoring cache for each request. If true, cache will not be used.

public Task<SetCacheDisabledCommandResponse?> SetCacheDisabled(SetCacheDisabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCacheDisabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCacheDisabledCommandResponse>

SetCookie(SetCookieCommandSettings, CancellationToken, int?, bool)

Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

public Task<SetCookieCommandResponse> SetCookie(SetCookieCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCookieCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCookieCommandResponse>

SetCookieControls(SetCookieControlsCommandSettings, CancellationToken, int?, bool)

Sets Controls for third-party cookie access Page reload is required before the new cookie behavior will be observed

public Task<SetCookieControlsCommandResponse?> SetCookieControls(SetCookieControlsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCookieControlsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCookieControlsCommandResponse>

SetCookies(SetCookiesCommandSettings, CancellationToken, int?, bool)

Sets given cookies.

public Task<SetCookiesCommandResponse?> SetCookies(SetCookiesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCookiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCookiesCommandResponse>

SetExtraHTTPHeaders(SetExtraHTTPHeadersCommandSettings, CancellationToken, int?, bool)

Specifies whether to always send extra HTTP headers with the requests from this page.

public Task<SetExtraHTTPHeadersCommandResponse?> SetExtraHTTPHeaders(SetExtraHTTPHeadersCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetExtraHTTPHeadersCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetExtraHTTPHeadersCommandResponse>

SetRequestInterception(SetRequestInterceptionCommandSettings, CancellationToken, int?, bool)

Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.

public Task<SetRequestInterceptionCommandResponse?> SetRequestInterception(SetRequestInterceptionCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetRequestInterceptionCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetRequestInterceptionCommandResponse>

SetUserAgentOverride(SetUserAgentOverrideCommandSettings, CancellationToken, int?, bool)

Allows overriding user agent with the given string.

public Task<SetUserAgentOverrideCommandResponse?> SetUserAgentOverride(SetUserAgentOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetUserAgentOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetUserAgentOverrideCommandResponse>

StreamResourceContent(StreamResourceContentCommandSettings, CancellationToken, int?, bool)

Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.

public Task<StreamResourceContentCommandResponse> StreamResourceContent(StreamResourceContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StreamResourceContentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StreamResourceContentCommandResponse>

TakeResponseBodyForInterceptionAsStream(TakeResponseBodyForInterceptionAsStreamCommandSettings, CancellationToken, int?, bool)

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.

public Task<TakeResponseBodyForInterceptionAsStreamCommandResponse> TakeResponseBodyForInterceptionAsStream(TakeResponseBodyForInterceptionAsStreamCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command TakeResponseBodyForInterceptionAsStreamCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<TakeResponseBodyForInterceptionAsStreamCommandResponse>

Events

DataReceived

Fired when data chunk was received over the network.

public event EventHandler<DataReceivedEventArgs>? DataReceived

Event Type

EventHandler<DataReceivedEventArgs>

DeviceBoundSessionEventOccurred

Triggered when a device bound session event occurs.

public event EventHandler<DeviceBoundSessionEventOccurredEventArgs>? DeviceBoundSessionEventOccurred

Event Type

EventHandler<DeviceBoundSessionEventOccurredEventArgs>

DeviceBoundSessionsAdded

Triggered when the initial set of device bound sessions is added.

public event EventHandler<DeviceBoundSessionsAddedEventArgs>? DeviceBoundSessionsAdded

Event Type

EventHandler<DeviceBoundSessionsAddedEventArgs>

DirectTCPSocketAborted

Fired when direct_socket.TCPSocket is aborted.

public event EventHandler<DirectTCPSocketAbortedEventArgs>? DirectTCPSocketAborted

Event Type

EventHandler<DirectTCPSocketAbortedEventArgs>

DirectTCPSocketChunkReceived

Fired when data is received from tcp direct socket stream.

public event EventHandler<DirectTCPSocketChunkReceivedEventArgs>? DirectTCPSocketChunkReceived

Event Type

EventHandler<DirectTCPSocketChunkReceivedEventArgs>

DirectTCPSocketChunkSent

Fired when data is sent to tcp direct socket stream.

public event EventHandler<DirectTCPSocketChunkSentEventArgs>? DirectTCPSocketChunkSent

Event Type

EventHandler<DirectTCPSocketChunkSentEventArgs>

DirectTCPSocketClosed

Fired when direct_socket.TCPSocket is closed.

public event EventHandler<DirectTCPSocketClosedEventArgs>? DirectTCPSocketClosed

Event Type

EventHandler<DirectTCPSocketClosedEventArgs>

DirectTCPSocketCreated

Fired upon direct_socket.TCPSocket creation.

public event EventHandler<DirectTCPSocketCreatedEventArgs>? DirectTCPSocketCreated

Event Type

EventHandler<DirectTCPSocketCreatedEventArgs>

DirectTCPSocketOpened

Fired when direct_socket.TCPSocket connection is opened.

public event EventHandler<DirectTCPSocketOpenedEventArgs>? DirectTCPSocketOpened

Event Type

EventHandler<DirectTCPSocketOpenedEventArgs>

DirectUDPSocketAborted

Fired when direct_socket.UDPSocket is aborted.

public event EventHandler<DirectUDPSocketAbortedEventArgs>? DirectUDPSocketAborted

Event Type

EventHandler<DirectUDPSocketAbortedEventArgs>

DirectUDPSocketChunkReceived

Fired when message is received from udp direct socket stream.

public event EventHandler<DirectUDPSocketChunkReceivedEventArgs>? DirectUDPSocketChunkReceived

Event Type

EventHandler<DirectUDPSocketChunkReceivedEventArgs>

DirectUDPSocketChunkSent

Fired when message is sent to udp direct socket stream.

public event EventHandler<DirectUDPSocketChunkSentEventArgs>? DirectUDPSocketChunkSent

Event Type

EventHandler<DirectUDPSocketChunkSentEventArgs>

DirectUDPSocketClosed

Fired when direct_socket.UDPSocket is closed.

public event EventHandler<DirectUDPSocketClosedEventArgs>? DirectUDPSocketClosed

Event Type

EventHandler<DirectUDPSocketClosedEventArgs>

DirectUDPSocketCreated

Fired upon direct_socket.UDPSocket creation.

public event EventHandler<DirectUDPSocketCreatedEventArgs>? DirectUDPSocketCreated

Event Type

EventHandler<DirectUDPSocketCreatedEventArgs>

DirectUDPSocketJoinedMulticastGroup

directUDPSocketJoinedMulticastGroup

public event EventHandler<DirectUDPSocketJoinedMulticastGroupEventArgs>? DirectUDPSocketJoinedMulticastGroup

Event Type

EventHandler<DirectUDPSocketJoinedMulticastGroupEventArgs>

DirectUDPSocketLeftMulticastGroup

directUDPSocketLeftMulticastGroup

public event EventHandler<DirectUDPSocketLeftMulticastGroupEventArgs>? DirectUDPSocketLeftMulticastGroup

Event Type

EventHandler<DirectUDPSocketLeftMulticastGroupEventArgs>

DirectUDPSocketOpened

Fired when direct_socket.UDPSocket connection is opened.

public event EventHandler<DirectUDPSocketOpenedEventArgs>? DirectUDPSocketOpened

Event Type

EventHandler<DirectUDPSocketOpenedEventArgs>

EventSourceMessageReceived

Fired when EventSource message is received.

public event EventHandler<EventSourceMessageReceivedEventArgs>? EventSourceMessageReceived

Event Type

EventHandler<EventSourceMessageReceivedEventArgs>

LoadingFailed

Fired when HTTP request has failed to load.

public event EventHandler<LoadingFailedEventArgs>? LoadingFailed

Event Type

EventHandler<LoadingFailedEventArgs>

LoadingFinished

Fired when HTTP request has finished loading.

public event EventHandler<LoadingFinishedEventArgs>? LoadingFinished

Event Type

EventHandler<LoadingFinishedEventArgs>

PolicyUpdated

Fired once security policy has been updated.

public event EventHandler<PolicyUpdatedEventArgs>? PolicyUpdated

Event Type

EventHandler<PolicyUpdatedEventArgs>

ReportingApiEndpointsChangedForOrigin

reportingApiEndpointsChangedForOrigin

public event EventHandler<ReportingApiEndpointsChangedForOriginEventArgs>? ReportingApiEndpointsChangedForOrigin

Event Type

EventHandler<ReportingApiEndpointsChangedForOriginEventArgs>

ReportingApiReportAdded

Is sent whenever a new report is added. And after 'enableReportingApi' for all existing reports.

public event EventHandler<ReportingApiReportAddedEventArgs>? ReportingApiReportAdded

Event Type

EventHandler<ReportingApiReportAddedEventArgs>

ReportingApiReportUpdated

reportingApiReportUpdated

public event EventHandler<ReportingApiReportUpdatedEventArgs>? ReportingApiReportUpdated

Event Type

EventHandler<ReportingApiReportUpdatedEventArgs>

RequestIntercepted

Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. Deprecated, use Fetch.requestPaused instead.

public event EventHandler<RequestInterceptedEventArgs>? RequestIntercepted

Event Type

EventHandler<RequestInterceptedEventArgs>

RequestServedFromCache

Fired if request ended up loading from cache.

public event EventHandler<RequestServedFromCacheEventArgs>? RequestServedFromCache

Event Type

EventHandler<RequestServedFromCacheEventArgs>

RequestWillBeSent

Fired when page is about to send HTTP request.

public event EventHandler<RequestWillBeSentEventArgs>? RequestWillBeSent

Event Type

EventHandler<RequestWillBeSentEventArgs>

RequestWillBeSentExtraInfo

Fired when additional information about a requestWillBeSent event is available from the network stack. Not every requestWillBeSent event will have an additional requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will be fired first for the same request.

public event EventHandler<RequestWillBeSentExtraInfoEventArgs>? RequestWillBeSentExtraInfo

Event Type

EventHandler<RequestWillBeSentExtraInfoEventArgs>

ResourceChangedPriority

Fired when resource loading priority is changed

public event EventHandler<ResourceChangedPriorityEventArgs>? ResourceChangedPriority

Event Type

EventHandler<ResourceChangedPriorityEventArgs>

ResponseReceived

Fired when HTTP response is available.

public event EventHandler<ResponseReceivedEventArgs>? ResponseReceived

Event Type

EventHandler<ResponseReceivedEventArgs>

ResponseReceivedEarlyHints

Fired when 103 Early Hints headers is received in addition to the common response. Not every responseReceived event will have an responseReceivedEarlyHints fired. Only one responseReceivedEarlyHints may be fired for eached responseReceived event.

public event EventHandler<ResponseReceivedEarlyHintsEventArgs>? ResponseReceivedEarlyHints

Event Type

EventHandler<ResponseReceivedEarlyHintsEventArgs>

ResponseReceivedExtraInfo

Fired when additional information about a responseReceived event is available from the network stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for it, and responseReceivedExtraInfo may be fired before or after responseReceived.

public event EventHandler<ResponseReceivedExtraInfoEventArgs>? ResponseReceivedExtraInfo

Event Type

EventHandler<ResponseReceivedExtraInfoEventArgs>

SignedExchangeReceived

Fired when a signed exchange was received over the network

public event EventHandler<SignedExchangeReceivedEventArgs>? SignedExchangeReceived

Event Type

EventHandler<SignedExchangeReceivedEventArgs>

TrustTokenOperationDone

Fired exactly once for each Trust Token operation. Depending on the type of the operation and whether the operation succeeded or failed, the event is fired before the corresponding request was sent or after the response was received.

public event EventHandler<TrustTokenOperationDoneEventArgs>? TrustTokenOperationDone

Event Type

EventHandler<TrustTokenOperationDoneEventArgs>

WebSocketClosed

Fired when WebSocket is closed.

public event EventHandler<WebSocketClosedEventArgs>? WebSocketClosed

Event Type

EventHandler<WebSocketClosedEventArgs>

WebSocketCreated

Fired upon WebSocket creation.

public event EventHandler<WebSocketCreatedEventArgs>? WebSocketCreated

Event Type

EventHandler<WebSocketCreatedEventArgs>

WebSocketFrameError

Fired when WebSocket message error occurs.

public event EventHandler<WebSocketFrameErrorEventArgs>? WebSocketFrameError

Event Type

EventHandler<WebSocketFrameErrorEventArgs>

WebSocketFrameReceived

Fired when WebSocket message is received.

public event EventHandler<WebSocketFrameReceivedEventArgs>? WebSocketFrameReceived

Event Type

EventHandler<WebSocketFrameReceivedEventArgs>

WebSocketFrameSent

Fired when WebSocket message is sent.

public event EventHandler<WebSocketFrameSentEventArgs>? WebSocketFrameSent

Event Type

EventHandler<WebSocketFrameSentEventArgs>

WebSocketHandshakeResponseReceived

Fired when WebSocket handshake response becomes available.

public event EventHandler<WebSocketHandshakeResponseReceivedEventArgs>? WebSocketHandshakeResponseReceived

Event Type

EventHandler<WebSocketHandshakeResponseReceivedEventArgs>

WebSocketWillSendHandshakeRequest

Fired when WebSocket is about to initiate handshake.

public event EventHandler<WebSocketWillSendHandshakeRequestEventArgs>? WebSocketWillSendHandshakeRequest

Event Type

EventHandler<WebSocketWillSendHandshakeRequestEventArgs>

WebTransportClosed

Fired when WebTransport is disposed.

public event EventHandler<WebTransportClosedEventArgs>? WebTransportClosed

Event Type

EventHandler<WebTransportClosedEventArgs>

WebTransportConnectionEstablished

Fired when WebTransport handshake is finished.

public event EventHandler<WebTransportConnectionEstablishedEventArgs>? WebTransportConnectionEstablished

Event Type

EventHandler<WebTransportConnectionEstablishedEventArgs>

WebTransportCreated

Fired upon WebTransport creation.

public event EventHandler<WebTransportCreatedEventArgs>? WebTransportCreated

Event Type

EventHandler<WebTransportCreatedEventArgs>