Network

class Network(cdp: CDP) : Domain

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.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard

The reason why Chrome uses a specific transport protocol for HTTP semantics.

Link copied to clipboard
@Serializable
data class AssociatedCookie(val cookie: Network.Cookie, val blockedReasons: List<Network.CookieBlockedReason>, val exemptionReason: Network.CookieExemptionReason? = null)

A cookie associated with the request which may or may not be sent with it. Includes the cookies itself and reasons for blocking or exemption.

Link copied to clipboard
@Serializable
data class AuthChallenge(val source: String? = null, val origin: String, val scheme: String, val realm: String)

Authorization challenge for HTTP status code 401 or 407.

Link copied to clipboard
@Serializable
data class AuthChallengeResponse(val response: String, val username: String? = null, val password: String? = null)

Response to an AuthChallenge.

Link copied to clipboard

The reason why request was blocked.

Link copied to clipboard
@Serializable
data class BlockedSetCookieWithReason(val blockedReasons: List<Network.SetCookieBlockedReason>, val cookieLine: String, val cookie: Network.Cookie? = null)

A cookie which was not stored from a response with the corresponding reason.

Link copied to clipboard
@Serializable
data class CachedResource(val url: String, val type: Network.ResourceType, val response: Network.Response? = null, val bodySize: Double)

Information about the cached resource.

Link copied to clipboard
@Serializable
data class CanClearBrowserCacheReturn(val result: Boolean)
Link copied to clipboard
@Serializable
data class CanClearBrowserCookiesReturn(val result: Boolean)
Link copied to clipboard
@Serializable
data class CanEmulateNetworkConditionsReturn(val result: Boolean)
Link copied to clipboard

Whether the request complied with Certificate Transparency policy.

Link copied to clipboard
@Serializable
data class ClientSecurityState(val initiatorIsSecureContext: Boolean, val initiatorIPAddressSpace: Network.IPAddressSpace, val privateNetworkRequestPolicy: Network.PrivateNetworkRequestPolicy)
Link copied to clipboard

The underlying connection technology that the browser is supposedly using.

Link copied to clipboard
@Serializable
data class ConnectTiming(val requestTime: Double)
Link copied to clipboard

List of content encodings supported by the backend.

Link copied to clipboard
@Serializable
data class ContentSecurityPolicyStatus(val effectiveDirectives: String, val isEnforced: Boolean, val source: Network.ContentSecurityPolicySource)
Link copied to clipboard
@Serializable
data class ContinueInterceptedRequestParameter(val interceptionId: String, val errorReason: Network.ErrorReason? = null, val rawResponse: String? = null, val url: String? = null, val method: String? = null, val postData: String? = null, val headers: Map<String, JsonElement>? = null, val authChallengeResponse: Network.AuthChallengeResponse? = null)
Link copied to clipboard
@Serializable
data class Cookie(val name: String, val value: String, val domain: String, val path: String, val expires: Double, val size: Int, val httpOnly: Boolean, val secure: Boolean, val session: Boolean, val sameSite: Network.CookieSameSite? = null, val priority: Network.CookiePriority, val sameParty: Boolean, val sourceScheme: Network.CookieSourceScheme, val sourcePort: Int, val partitionKey: Network.CookiePartitionKey? = null, val partitionKeyOpaque: Boolean? = null)

Cookie object

Link copied to clipboard

Types of reasons why a cookie may not be sent with a request.

Link copied to clipboard

Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.

Link copied to clipboard
@Serializable
data class CookieParam(val name: String, val value: String, val url: String? = null, val domain: String? = null, val path: String? = null, val secure: Boolean? = null, val httpOnly: Boolean? = null, val sameSite: Network.CookieSameSite? = null, val expires: Double? = null, val priority: Network.CookiePriority? = null, val sameParty: Boolean? = null, val sourceScheme: Network.CookieSourceScheme? = null, val sourcePort: Int? = null, val partitionKey: Network.CookiePartitionKey? = null)

Cookie parameter object

Link copied to clipboard
@Serializable
data class CookiePartitionKey(val topLevelSite: String, val hasCrossSiteAncestor: Boolean)

cookiePartitionKey object The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h.

Link copied to clipboard

Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00

Link copied to clipboard

Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies

Link copied to clipboard

Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future.

Link copied to clipboard
@Serializable
enum CorsError : Enum<Network.CorsError>

The reason why request was blocked.

Link copied to clipboard
@Serializable
data class CorsErrorStatus(val corsError: Network.CorsError, val failedParameter: String)
Link copied to clipboard
@Serializable
data class CrossOriginEmbedderPolicyStatus(val value: Network.CrossOriginEmbedderPolicyValue, val reportOnlyValue: Network.CrossOriginEmbedderPolicyValue, val reportingEndpoint: String? = null, val reportOnlyReportingEndpoint: String? = null)
Link copied to clipboard
@Serializable
data class CrossOriginOpenerPolicyStatus(val value: Network.CrossOriginOpenerPolicyValue, val reportOnlyValue: Network.CrossOriginOpenerPolicyValue, val reportingEndpoint: String? = null, val reportOnlyReportingEndpoint: String? = null)
Link copied to clipboard
@Serializable
data class DataReceivedParameter(val requestId: String, val timestamp: Double, val dataLength: Int, val encodedDataLength: Int, val data: String? = null)

Fired when data chunk was received over the network.

Link copied to clipboard
@Serializable
data class DeleteCookiesParameter(val name: String, val url: String? = null, val domain: String? = null, val path: String? = null, val partitionKey: Network.CookiePartitionKey? = null)
Link copied to clipboard
@Serializable
data class DirectTCPSocketAbortedParameter(val identifier: String, val errorMessage: String, val timestamp: Double)

Fired when direct_socket.TCPSocket is aborted.

Link copied to clipboard
@Serializable
data class DirectTCPSocketChunkReceivedParameter(val identifier: String, val data: String, val timestamp: Double)

Fired when data is received from tcp direct socket stream.

Link copied to clipboard
@Serializable
data class DirectTCPSocketChunkSentParameter(val identifier: String, val data: String, val timestamp: Double)

Fired when data is sent to tcp direct socket stream.

Link copied to clipboard
@Serializable
data class DirectTCPSocketClosedParameter(val identifier: String, val timestamp: Double)

Fired when direct_socket.TCPSocket is closed.

Link copied to clipboard
@Serializable
data class DirectTCPSocketCreatedParameter(val identifier: String, val remoteAddr: String, val remotePort: Int, val options: Network.DirectTCPSocketOptions, val timestamp: Double, val initiator: Network.Initiator? = null)

Fired upon direct_socket.TCPSocket creation.

Link copied to clipboard
@Serializable
data class DirectTCPSocketOpenedParameter(val identifier: String, val remoteAddr: String, val remotePort: Int, val timestamp: Double, val localAddr: String? = null, val localPort: Int? = null)

Fired when direct_socket.TCPSocket connection is opened.

Link copied to clipboard
@Serializable
data class DirectTCPSocketOptions(val noDelay: Boolean, val keepAliveDelay: Double? = null, val sendBufferSize: Double? = null, val receiveBufferSize: Double? = null, val dnsQueryType: Network.DirectSocketDnsQueryType? = null)
Link copied to clipboard
@Serializable
data class DirectUDPMessage(val data: String, val remoteAddr: String? = null, val remotePort: Int? = null)
Link copied to clipboard
@Serializable
data class DirectUDPSocketAbortedParameter(val identifier: String, val errorMessage: String, val timestamp: Double)

Fired when direct_socket.UDPSocket is aborted.

Link copied to clipboard
@Serializable
data class DirectUDPSocketChunkReceivedParameter(val identifier: String, val message: Network.DirectUDPMessage, val timestamp: Double)

Fired when message is received from udp direct socket stream.

Link copied to clipboard
@Serializable
data class DirectUDPSocketChunkSentParameter(val identifier: String, val message: Network.DirectUDPMessage, val timestamp: Double)

Fired when message is sent to udp direct socket stream.

Link copied to clipboard
@Serializable
data class DirectUDPSocketClosedParameter(val identifier: String, val timestamp: Double)

Fired when direct_socket.UDPSocket is closed.

Link copied to clipboard
@Serializable
data class DirectUDPSocketCreatedParameter(val identifier: String, val options: Network.DirectUDPSocketOptions, val timestamp: Double, val initiator: Network.Initiator? = null)

Fired upon direct_socket.UDPSocket creation.

Link copied to clipboard
@Serializable
data class DirectUDPSocketOpenedParameter(val identifier: String, val localAddr: String, val localPort: Int, val timestamp: Double, val remoteAddr: String? = null, val remotePort: Int? = null)

Fired when direct_socket.UDPSocket connection is opened.

Link copied to clipboard
@Serializable
data class DirectUDPSocketOptions(val remoteAddr: String? = null, val remotePort: Int? = null, val localAddr: String? = null, val localPort: Int? = null, val dnsQueryType: Network.DirectSocketDnsQueryType? = null, val sendBufferSize: Double? = null, val receiveBufferSize: Double? = null)
Link copied to clipboard
@Serializable
data class EmulateNetworkConditionsParameter(val offline: Boolean, val latency: Double, val downloadThroughput: Double, val uploadThroughput: Double, val connectionType: Network.ConnectionType? = null, val packetLoss: Double? = null, val packetQueueLength: Int? = null, val packetReordering: Boolean? = null)
Link copied to clipboard
@Serializable
data class EnableParameter(val maxTotalBufferSize: Int? = null, val maxResourceBufferSize: Int? = null, val maxPostDataSize: Int? = null, val reportDirectSocketTraffic: Boolean? = null)
Link copied to clipboard
@Serializable
data class EnableReportingApiParameter(val enable: Boolean)
Link copied to clipboard
@Serializable
enum ErrorReason : Enum<Network.ErrorReason>

Network level fetch failure reason.

Link copied to clipboard
@Serializable
data class EventSourceMessageReceivedParameter(val requestId: String, val timestamp: Double, val eventName: String, val eventId: String, val data: String)

Fired when EventSource message is received.

Link copied to clipboard
@Serializable
data class ExemptedSetCookieWithReason(val exemptionReason: Network.CookieExemptionReason, val cookieLine: String, val cookie: Network.Cookie)

A cookie should have been blocked by 3PCD but is exempted and stored from a response with the corresponding reason. A cookie could only have at most one exemption reason.

Link copied to clipboard
@Serializable
data class GetAllCookiesReturn(val cookies: List<Network.Cookie>)
Link copied to clipboard
@Serializable
data class GetCertificateParameter(val origin: String)
Link copied to clipboard
@Serializable
data class GetCertificateReturn(val tableNames: List<String>)
Link copied to clipboard
@Serializable
data class GetCookiesParameter(val urls: List<String>? = null)
Link copied to clipboard
@Serializable
data class GetCookiesReturn(val cookies: List<Network.Cookie>)
Link copied to clipboard
@Serializable
data class GetRequestPostDataParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class GetRequestPostDataReturn(val postData: String)
Link copied to clipboard
@Serializable
data class GetResponseBodyForInterceptionParameter(val interceptionId: String)
Link copied to clipboard
@Serializable
data class GetResponseBodyForInterceptionReturn(val body: String, val base64Encoded: Boolean)
Link copied to clipboard
@Serializable
data class GetResponseBodyParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class GetResponseBodyReturn(val body: String, val base64Encoded: Boolean)
Link copied to clipboard
@Serializable
data class GetSecurityIsolationStatusParameter(val frameId: String? = null)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class Initiator(val type: String, val stack: Runtime.StackTrace? = null, val url: String? = null, val lineNumber: Double? = null, val columnNumber: Double? = null, val requestId: String? = null)

Information about the request initiator.

Link copied to clipboard

Stages of the interception to begin intercepting. Request will intercept before the request is sent. Response will intercept after the response is received.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class LoadingFailedParameter(val requestId: String, val timestamp: Double, val type: Network.ResourceType, val errorText: String, val canceled: Boolean? = null, val blockedReason: Network.BlockedReason? = null, val corsErrorStatus: Network.CorsErrorStatus? = null)

Fired when HTTP request has failed to load.

Link copied to clipboard
@Serializable
data class LoadingFinishedParameter(val requestId: String, val timestamp: Double, val encodedDataLength: Double)

Fired when HTTP request has finished loading.

Link copied to clipboard
@Serializable
data class LoadNetworkResourceOptions(val disableCache: Boolean, val includeCredentials: Boolean)

An options object that may be extended later to better support CORS, CORB and streaming.

Link copied to clipboard
@Serializable
data class LoadNetworkResourcePageResult(val success: Boolean, val netError: Double? = null, val netErrorName: String? = null, val httpStatusCode: Double? = null, val stream: String? = null, val headers: Map<String, JsonElement>? = null)

An object providing the result of a network resource load.

Link copied to clipboard
@Serializable
data class LoadNetworkResourceParameter(val frameId: String? = null, val url: String, val options: Network.LoadNetworkResourceOptions)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class PostDataEntry(val bytes: String? = null)

Post data entry for HTTP request

Link copied to clipboard
@Serializable
data class ReplayXHRParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class ReportingApiEndpoint(val url: String, val groupName: String)
Link copied to clipboard
@Serializable
data class ReportingApiReport(val id: String, val initiatorUrl: String, val destination: String, val type: String, val timestamp: Double, val depth: Int, val completedAttempts: Int, val body: Map<String, JsonElement>, val status: Network.ReportStatus)

An object representing a report generated by the Reporting API.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
@Serializable
enum ReportStatus : Enum<Network.ReportStatus>

The status of a Reporting API report.

Link copied to clipboard
@Serializable
data class Request(val url: String, val urlFragment: String? = null, val method: String, val headers: Map<String, JsonElement>, val postData: String? = null, val hasPostData: Boolean? = null, val postDataEntries: List<Network.PostDataEntry>? = null, val mixedContentType: Security.MixedContentType? = null, val initialPriority: Network.ResourcePriority, val referrerPolicy: String, val isLinkPreload: Boolean? = null, val trustTokenParams: Network.TrustTokenParams? = null, val isSameSite: Boolean? = null)

HTTP request data.

Link copied to clipboard
@Serializable
data class RequestInterceptedParameter(val interceptionId: String, val request: Network.Request, val frameId: String, val resourceType: Network.ResourceType, val isNavigationRequest: Boolean, val isDownload: Boolean? = null, val redirectUrl: String? = null, val authChallenge: Network.AuthChallenge? = null, val responseErrorReason: Network.ErrorReason? = null, val responseStatusCode: Int? = null, val responseHeaders: Map<String, JsonElement>? = null, val requestId: String? = null)

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

Link copied to clipboard
@Serializable
data class RequestPattern(val urlPattern: String? = null, val resourceType: Network.ResourceType? = null, val interceptionStage: Network.InterceptionStage? = null)

Request pattern for interception.

Link copied to clipboard
@Serializable
data class RequestServedFromCacheParameter(val requestId: String)

Fired if request ended up loading from cache.

Link copied to clipboard
@Serializable
data class RequestWillBeSentExtraInfoParameter(val requestId: String, val associatedCookies: List<Network.AssociatedCookie>, val headers: Map<String, JsonElement>, val connectTiming: Network.ConnectTiming, val clientSecurityState: Network.ClientSecurityState? = null, val siteHasCookieInOtherPartition: Boolean? = null)

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.

Link copied to clipboard
@Serializable
data class RequestWillBeSentParameter(val requestId: String, val loaderId: String, val documentURL: String, val request: Network.Request, val timestamp: Double, val wallTime: Double, val initiator: Network.Initiator, val redirectHasExtraInfo: Boolean, val redirectResponse: Network.Response? = null, val type: Network.ResourceType? = null, val frameId: String? = null, val hasUserGesture: Boolean? = null)

Fired when page is about to send HTTP request.

Link copied to clipboard
@Serializable
data class ResourceChangedPriorityParameter(val requestId: String, val newPriority: Network.ResourcePriority, val timestamp: Double)

Fired when resource loading priority is changed

Link copied to clipboard

Loading priority of a resource request.

Link copied to clipboard
@Serializable
data class ResourceTiming(val requestTime: Double, val proxyStart: Double, val proxyEnd: Double, val dnsStart: Double, val dnsEnd: Double, val connectStart: Double, val connectEnd: Double, val sslStart: Double, val sslEnd: Double, val workerStart: Double, val workerReady: Double, val workerFetchStart: Double, val workerRespondWithSettled: Double, val workerRouterEvaluationStart: Double? = null, val workerCacheLookupStart: Double? = null, val sendStart: Double, val sendEnd: Double, val pushStart: Double, val pushEnd: Double, val receiveHeadersStart: Double, val receiveHeadersEnd: Double)

Timing information for the request.

Link copied to clipboard
@Serializable
enum ResourceType : Enum<Network.ResourceType>

Resource type as it was perceived by the rendering engine.

Link copied to clipboard
@Serializable
data class Response(val url: String, val status: Int, val statusText: String, val headers: Map<String, JsonElement>, val headersText: String? = null, val mimeType: String, val charset: String, val requestHeaders: Map<String, JsonElement>? = null, val requestHeadersText: String? = null, val connectionReused: Boolean, val connectionId: Double, val remoteIPAddress: String? = null, val remotePort: Int? = null, val fromDiskCache: Boolean? = null, val fromServiceWorker: Boolean? = null, val fromPrefetchCache: Boolean? = null, val fromEarlyHints: Boolean? = null, val serviceWorkerRouterInfo: Network.ServiceWorkerRouterInfo? = null, val encodedDataLength: Double, val timing: Network.ResourceTiming? = null, val serviceWorkerResponseSource: Network.ServiceWorkerResponseSource? = null, val responseTime: Double? = null, val cacheStorageCacheName: String? = null, val protocol: String? = null, val alternateProtocolUsage: Network.AlternateProtocolUsage? = null, val securityState: Security.SecurityState, val securityDetails: Network.SecurityDetails? = null)

HTTP response data.

Link copied to clipboard
@Serializable
data class ResponseReceivedEarlyHintsParameter(val requestId: String, val headers: Map<String, JsonElement>)

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.

Link copied to clipboard
@Serializable
data class ResponseReceivedExtraInfoParameter(val requestId: String, val blockedCookies: List<Network.BlockedSetCookieWithReason>, val headers: Map<String, JsonElement>, val resourceIPAddressSpace: Network.IPAddressSpace, val statusCode: Int, val headersText: String? = null, val cookiePartitionKey: Network.CookiePartitionKey? = null, val cookiePartitionKeyOpaque: Boolean? = null, val exemptedCookies: List<Network.ExemptedSetCookieWithReason>? = null)

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.

Link copied to clipboard
@Serializable
data class ResponseReceivedParameter(val requestId: String, val loaderId: String, val timestamp: Double, val type: Network.ResourceType, val response: Network.Response, val hasExtraInfo: Boolean, val frameId: String? = null)

Fired when HTTP response is available.

Link copied to clipboard
@Serializable
data class SearchInResponseBodyParameter(val requestId: String, val query: String, val caseSensitive: Boolean? = null, val isRegex: Boolean? = null)
Link copied to clipboard
@Serializable
data class SearchInResponseBodyReturn(val result: List<Debugger.SearchMatch>)
Link copied to clipboard
@Serializable
data class SecurityDetails(val protocol: String, val keyExchange: String, val keyExchangeGroup: String? = null, val cipher: String, val mac: String? = null, val certificateId: Int, val subjectName: String, val sanList: List<String>, val issuer: String, val validFrom: Double, val validTo: Double, val signedCertificateTimestampList: List<Network.SignedCertificateTimestamp>, val certificateTransparencyCompliance: Network.CertificateTransparencyCompliance, val serverSignatureAlgorithm: Int? = null, val encryptedClientHello: Boolean)

Security details about a request.

Link copied to clipboard
Link copied to clipboard

Source of serviceworker response.

Link copied to clipboard
@Serializable
data class ServiceWorkerRouterInfo(val ruleIdMatched: Int? = null, val matchedSourceType: Network.ServiceWorkerRouterSource? = null, val actualSourceType: Network.ServiceWorkerRouterSource? = null)
Link copied to clipboard

Source of service worker router.

Link copied to clipboard
@Serializable
data class SetAcceptedEncodingsParameter(val encodings: List<Network.ContentEncoding>)
Link copied to clipboard
@Serializable
data class SetAttachDebugStackParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetBlockedURLsParameter(val urls: List<String>)
Link copied to clipboard
@Serializable
data class SetBypassServiceWorkerParameter(val bypass: Boolean)
Link copied to clipboard
@Serializable
data class SetCacheDisabledParameter(val cacheDisabled: Boolean)
Link copied to clipboard

Types of reasons why a cookie may not be stored from a response.

Link copied to clipboard
@Serializable
data class SetCookieControlsParameter(val enableThirdPartyCookieRestriction: Boolean, val disableThirdPartyCookieMetadata: Boolean, val disableThirdPartyCookieHeuristics: Boolean)
Link copied to clipboard
@Serializable
data class SetCookieParameter(val name: String, val value: String, val url: String? = null, val domain: String? = null, val path: String? = null, val secure: Boolean? = null, val httpOnly: Boolean? = null, val sameSite: Network.CookieSameSite? = null, val expires: Double? = null, val priority: Network.CookiePriority? = null, val sameParty: Boolean? = null, val sourceScheme: Network.CookieSourceScheme? = null, val sourcePort: Int? = null, val partitionKey: Network.CookiePartitionKey? = null)
Link copied to clipboard
@Serializable
data class SetCookieReturn(val success: Boolean)
Link copied to clipboard
@Serializable
data class SetCookiesParameter(val cookies: List<Network.CookieParam>)
Link copied to clipboard
@Serializable
data class SetExtraHTTPHeadersParameter(val headers: Map<String, JsonElement>)
Link copied to clipboard
@Serializable
data class SetRequestInterceptionParameter(val patterns: List<Network.RequestPattern>)
Link copied to clipboard
@Serializable
data class SetUserAgentOverrideParameter(val userAgent: String, val acceptLanguage: String? = null, val platform: String? = null, val userAgentMetadata: Emulation.UserAgentMetadata? = null)
Link copied to clipboard
@Serializable
data class SignedCertificateTimestamp(val status: String, val origin: String, val logDescription: String, val logId: String, val timestamp: Double, val hashAlgorithm: String, val signatureAlgorithm: String, val signatureData: String)

Details of a signed certificate timestamp (SCT).

Link copied to clipboard
@Serializable
data class SignedExchangeError(val message: String, val signatureIndex: Int? = null, val errorField: Network.SignedExchangeErrorField? = null)

Information about a signed exchange response.

Link copied to clipboard

Field type for a signed exchange related error.

Link copied to clipboard
@Serializable
data class SignedExchangeHeader(val requestUrl: String, val responseCode: Int, val responseHeaders: Map<String, JsonElement>, val signatures: List<Network.SignedExchangeSignature>, val headerIntegrity: String)

Information about a signed exchange header. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation

Link copied to clipboard
@Serializable
data class SignedExchangeInfo(val outerResponse: Network.Response, val hasExtraInfo: Boolean, val header: Network.SignedExchangeHeader? = null, val securityDetails: Network.SecurityDetails? = null, val errors: List<Network.SignedExchangeError>? = null)

Information about a signed exchange response.

Link copied to clipboard
@Serializable
data class SignedExchangeReceivedParameter(val requestId: String, val info: Network.SignedExchangeInfo)

Fired when a signed exchange was received over the network

Link copied to clipboard
@Serializable
data class SignedExchangeSignature(val label: String, val signature: String, val integrity: String, val certUrl: String? = null, val certSha256: String? = null, val validityUrl: String, val date: Int, val expires: Int, val certificates: List<String>? = null)

Information about a signed exchange signature. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1

Link copied to clipboard
@Serializable
data class StreamResourceContentParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class StreamResourceContentReturn(val bufferedData: String)
@Serializable
data class SubresourceWebBundleInnerResponseErrorParameter(val innerRequestId: String, val innerRequestURL: String, val errorMessage: String, val bundleRequestId: String? = null)

Fired when request for resources within a .wbn file failed.

@Serializable
data class SubresourceWebBundleInnerResponseParsedParameter(val innerRequestId: String, val innerRequestURL: String, val bundleRequestId: String? = null)

Fired when handling requests for resources within a .wbn file. Note: this will only be fired for resources that are requested by the webpage.

@Serializable
data class SubresourceWebBundleMetadataErrorParameter(val requestId: String, val errorMessage: String)

Fired once when parsing the .wbn file has failed.

@Serializable
data class SubresourceWebBundleMetadataReceivedParameter(val requestId: String, val urls: List<String>)

Fired once when parsing the .wbn file has succeeded. The event contains the information about the web bundle contents.

@Serializable
data class TakeResponseBodyForInterceptionAsStreamParameter(val interceptionId: String)
@Serializable
data class TakeResponseBodyForInterceptionAsStreamReturn(val stream: String)
Link copied to clipboard
@Serializable
data class TrustTokenOperationDoneParameter(val status: String, val type: Network.TrustTokenOperationType, val requestId: String, val topLevelOrigin: String? = null, val issuerOrigin: String? = null, val issuedTokenCount: Int? = null)

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.

Link copied to clipboard
@Serializable
data class TrustTokenParams(val operation: Network.TrustTokenOperationType, val refreshPolicy: String, val issuers: List<String>? = null)

Determines what type of Trust Token operation is executed and depending on the type, some additional parameters. The values are specified in third_party/blink/renderer/core/fetch/trust_token.idl.

Link copied to clipboard
@Serializable
data class WebSocketClosedParameter(val requestId: String, val timestamp: Double)

Fired when WebSocket is closed.

Link copied to clipboard
@Serializable
data class WebSocketCreatedParameter(val requestId: String, val url: String, val initiator: Network.Initiator? = null)

Fired upon WebSocket creation.

Link copied to clipboard
@Serializable
data class WebSocketFrame(val opcode: Double, val mask: Boolean, val payloadData: String)

WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.

Link copied to clipboard
@Serializable
data class WebSocketFrameErrorParameter(val requestId: String, val timestamp: Double, val errorMessage: String)

Fired when WebSocket message error occurs.

Link copied to clipboard
@Serializable
data class WebSocketFrameReceivedParameter(val requestId: String, val timestamp: Double, val response: Network.WebSocketFrame)

Fired when WebSocket message is received.

Link copied to clipboard
@Serializable
data class WebSocketFrameSentParameter(val requestId: String, val timestamp: Double, val response: Network.WebSocketFrame)

Fired when WebSocket message is sent.

@Serializable
data class WebSocketHandshakeResponseReceivedParameter(val requestId: String, val timestamp: Double, val response: Network.WebSocketResponse)

Fired when WebSocket handshake response becomes available.

Link copied to clipboard
@Serializable
data class WebSocketRequest(val headers: Map<String, JsonElement>)

WebSocket request data.

Link copied to clipboard
@Serializable
data class WebSocketResponse(val status: Int, val statusText: String, val headers: Map<String, JsonElement>, val headersText: String? = null, val requestHeaders: Map<String, JsonElement>? = null, val requestHeadersText: String? = null)

WebSocket response data.

@Serializable
data class WebSocketWillSendHandshakeRequestParameter(val requestId: String, val timestamp: Double, val wallTime: Double, val request: Network.WebSocketRequest)

Fired when WebSocket is about to initiate handshake.

Link copied to clipboard
@Serializable
data class WebTransportClosedParameter(val transportId: String, val timestamp: Double)

Fired when WebTransport is disposed.

@Serializable
data class WebTransportConnectionEstablishedParameter(val transportId: String, val timestamp: Double)

Fired when WebTransport handshake is finished.

Link copied to clipboard
@Serializable
data class WebTransportCreatedParameter(val transportId: String, val url: String, val timestamp: Double, val initiator: Network.Initiator? = null)

Fired upon WebTransport creation.

Properties

Link copied to clipboard

Fired when data chunk was received over the network.

Link copied to clipboard

Fired when direct_socket.TCPSocket is aborted.

Link copied to clipboard

Fired when data is received from tcp direct socket stream.

Link copied to clipboard

Fired when data is sent to tcp direct socket stream.

Link copied to clipboard

Fired when direct_socket.TCPSocket is closed.

Link copied to clipboard

Fired upon direct_socket.TCPSocket creation.

Link copied to clipboard

Fired when direct_socket.TCPSocket connection is opened.

Link copied to clipboard

Fired when direct_socket.UDPSocket is aborted.

Link copied to clipboard

Fired when message is received from udp direct socket stream.

Link copied to clipboard

Fired when message is sent to udp direct socket stream.

Link copied to clipboard

Fired when direct_socket.UDPSocket is closed.

Link copied to clipboard

Fired upon direct_socket.UDPSocket creation.

Link copied to clipboard

Fired when direct_socket.UDPSocket connection is opened.

Link copied to clipboard

Fired when EventSource message is received.

Link copied to clipboard

Fired when HTTP request has failed to load.

Link copied to clipboard

Fired when HTTP request has finished loading.

Link copied to clipboard
val policyUpdated: Flow<Unit>

Fired once security policy has been updated.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Fired if request ended up loading from cache.

Link copied to clipboard

Fired when page is about to send HTTP request.

Link copied to clipboard

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.

Link copied to clipboard

Fired when resource loading priority is changed

Link copied to clipboard

Fired when HTTP response is available.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Fired when a signed exchange was received over the network

Link copied to clipboard

Fired when request for resources within a .wbn file failed.

Link copied to clipboard

Fired when handling requests for resources within a .wbn file. Note: this will only be fired for resources that are requested by the webpage.

Link copied to clipboard

Fired once when parsing the .wbn file has failed.

Link copied to clipboard

Fired once when parsing the .wbn file has succeeded. The event contains the information about the web bundle contents.

Link copied to clipboard

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.

Link copied to clipboard

Fired when WebSocket is closed.

Link copied to clipboard

Fired upon WebSocket creation.

Link copied to clipboard

Fired when WebSocket message error occurs.

Link copied to clipboard

Fired when WebSocket message is received.

Link copied to clipboard

Fired when WebSocket message is sent.

Link copied to clipboard

Fired when WebSocket handshake response becomes available.

Link copied to clipboard

Fired when WebSocket is about to initiate handshake.

Link copied to clipboard

Fired when WebTransport is disposed.

Link copied to clipboard

Fired when WebTransport handshake is finished.

Link copied to clipboard

Fired upon WebTransport creation.

Functions

Link copied to clipboard
suspend fun canClearBrowserCache(mode: CommandMode = CommandMode.DEFAULT): Network.CanClearBrowserCacheReturn

Tells whether clearing browser cache is supported.

Link copied to clipboard

Tells whether clearing browser cookies is supported.

Link copied to clipboard

Tells whether emulation of network conditions is supported.

Link copied to clipboard
suspend fun clearAcceptedEncodingsOverride(mode: CommandMode = CommandMode.DEFAULT)

Clears accepted encodings set by setAcceptedEncodings

Link copied to clipboard
suspend fun clearBrowserCache(mode: CommandMode = CommandMode.DEFAULT)

Clears browser cache.

Link copied to clipboard
suspend fun clearBrowserCookies(mode: CommandMode = CommandMode.DEFAULT)

Clears browser cookies.

Link copied to clipboard
suspend fun continueInterceptedRequest(interceptionId: String, errorReason: Network.ErrorReason? = null, rawResponse: String? = null, url: String? = null, method: String? = null, postData: String? = null, headers: Map<String, JsonElement>? = null, authChallengeResponse: Network.AuthChallengeResponse? = null)

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.

Link copied to clipboard
suspend fun deleteCookies(args: Network.DeleteCookiesParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun deleteCookies(name: String, url: String? = null, domain: String? = null, path: String? = null, partitionKey: Network.CookiePartitionKey? = null)

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

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun emulateNetworkConditions(offline: Boolean, latency: Double, downloadThroughput: Double, uploadThroughput: Double, connectionType: Network.ConnectionType? = null, packetLoss: Double? = null, packetQueueLength: Int? = null, packetReordering: Boolean? = null)

Activates emulation of network conditions.

Link copied to clipboard
suspend fun enable(args: Network.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun enable(maxTotalBufferSize: Int? = null, maxResourceBufferSize: Int? = null, maxPostDataSize: Int? = null, reportDirectSocketTraffic: Boolean? = null)

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

Link copied to clipboard
suspend fun enableReportingApi(enable: Boolean)
suspend fun enableReportingApi(args: Network.EnableReportingApiParameter, mode: CommandMode = CommandMode.DEFAULT)

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.

Link copied to clipboard
suspend fun getAllCookies(mode: CommandMode = CommandMode.DEFAULT): Network.GetAllCookiesReturn

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

Link copied to clipboard

Returns the DER-encoded certificate.

Link copied to clipboard
suspend fun getCookies(urls: List<String>? = null): Network.GetCookiesReturn
suspend fun getCookies(args: Network.GetCookiesParameter, mode: CommandMode = CommandMode.DEFAULT): Network.GetCookiesReturn

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

Link copied to clipboard

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

Link copied to clipboard

Returns content served for the given request.

Link copied to clipboard

Returns content served for the given currently intercepted request.

Link copied to clipboard

Returns information about the COEP/COOP isolation status.

Link copied to clipboard

Fetches the resource and returns the content.

Link copied to clipboard
suspend fun replayXHR(requestId: String)
suspend fun replayXHR(args: Network.ReplayXHRParameter, mode: CommandMode = CommandMode.DEFAULT)

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.

Link copied to clipboard
suspend fun searchInResponseBody(requestId: String, query: String, caseSensitive: Boolean? = null, isRegex: Boolean? = null): Network.SearchInResponseBodyReturn

Searches for given string in response content.

Link copied to clipboard
suspend fun setAcceptedEncodings(args: Network.SetAcceptedEncodingsParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setAttachDebugStack(enabled: Boolean)
suspend fun setAttachDebugStack(args: Network.SetAttachDebugStackParameter, mode: CommandMode = CommandMode.DEFAULT)

Specifies whether to attach a page script stack id in requests

Link copied to clipboard
suspend fun setBlockedURLs(urls: List<String>)
suspend fun setBlockedURLs(args: Network.SetBlockedURLsParameter, mode: CommandMode = CommandMode.DEFAULT)

Blocks URLs from loading.

Link copied to clipboard
suspend fun setBypassServiceWorker(bypass: Boolean)
suspend fun setBypassServiceWorker(args: Network.SetBypassServiceWorkerParameter, mode: CommandMode = CommandMode.DEFAULT)

Toggles ignoring of service worker for each request.

Link copied to clipboard
suspend fun setCacheDisabled(cacheDisabled: Boolean)
suspend fun setCacheDisabled(args: Network.SetCacheDisabledParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setCookie(args: Network.SetCookieParameter, mode: CommandMode = CommandMode.DEFAULT): Network.SetCookieReturn
suspend fun setCookie(name: String, value: String, url: String? = null, domain: String? = null, path: String? = null, secure: Boolean? = null, httpOnly: Boolean? = null, sameSite: Network.CookieSameSite? = null, expires: Double? = null, priority: Network.CookiePriority? = null, sameParty: Boolean? = null, sourceScheme: Network.CookieSourceScheme? = null, sourcePort: Int? = null, partitionKey: Network.CookiePartitionKey? = null): Network.SetCookieReturn

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

Link copied to clipboard
suspend fun setCookieControls(args: Network.SetCookieControlsParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setCookieControls(enableThirdPartyCookieRestriction: Boolean, disableThirdPartyCookieMetadata: Boolean, disableThirdPartyCookieHeuristics: Boolean)

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

Link copied to clipboard
suspend fun setCookies(cookies: List<Network.CookieParam>)
suspend fun setCookies(args: Network.SetCookiesParameter, mode: CommandMode = CommandMode.DEFAULT)

Sets given cookies.

Link copied to clipboard
suspend fun setExtraHTTPHeaders(headers: Map<String, JsonElement>)
suspend fun setExtraHTTPHeaders(args: Network.SetExtraHTTPHeadersParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setRequestInterception(args: Network.SetRequestInterceptionParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setUserAgentOverride(args: Network.SetUserAgentOverrideParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setUserAgentOverride(userAgent: String, acceptLanguage: String? = null, platform: String? = null, userAgentMetadata: Emulation.UserAgentMetadata? = null)

Allows overriding user agent with the given string.

Link copied to clipboard

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

Link copied to clipboard

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.