Network 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.
Methods
- Network.clearBrowserCache
- Network.clearBrowserCookies
- Network.deleteCookies
- Network.disable
- Network.emulateNetworkConditions
- Network.enable
- Network.getCookies
- Network.getRequestPostData
- Network.getResponseBody
- Network.setBypassServiceWorker
- Network.setCacheDisabled
- Network.setCookie
- Network.setCookies
- Network.setExtraHTTPHeaders
- Network.setUserAgentOverride
Events
- Network.dataReceived
- Network.eventSourceMessageReceived
- Network.loadingFailed
- Network.loadingFinished
- Network.requestServedFromCache
- Network.requestWillBeSent
- Network.responseReceived
- Network.webSocketClosed
- Network.webSocketCreated
- Network.webSocketFrameError
- Network.webSocketFrameReceived
- Network.webSocketFrameSent
- Network.webSocketHandshakeResponseReceived
- Network.webSocketWillSendHandshakeRequest
- Network.webTransportClosed
- Network.webTransportConnectionEstablished
- Network.webTransportCreated
Types
- Network.BlockedReason
- Network.CachedResource
- Network.CertificateTransparencyCompliance
- Network.ConnectionType
- Network.Cookie
- Network.CookieParam
- Network.CookieSameSite
- Network.CorsError
- Network.CorsErrorStatus
- Network.ErrorReason
- Network.Headers
- Network.Initiator
- Network.InterceptionId
- Network.LoaderId
- Network.MonotonicTime
- Network.PostDataEntry
- Network.Request
- Network.RequestId
- Network.ResourcePriority
- Network.ResourceTiming
- Network.ResourceType
- Network.Response
- Network.SecurityDetails
- Network.ServiceWorkerResponseSource
- Network.ServiceWorkerRouterSource
- Network.SignedCertificateTimestamp
- Network.TimeSinceEpoch
- Network.WebSocketFrame
- Network.WebSocketRequest
- Network.WebSocketResponse
Methods
Network.deleteCookies #
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.
Parameters
name stringName of the cookies to remove.
urlOptional
stringIf specified, deletes all the cookies with the given name where domain and path match provided URL.
domainOptional
stringIf specified, deletes only cookies with the exact domain.
pathOptional
stringIf specified, deletes only cookies with the exact path.
partitionKeyOptional
If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.
Network.disable #
Disables network tracking, prevents network events from being sent to the client.
Network.disable support is experimental.
Disable network debugging. Returns false if not initially enabled.
@cdp Network.disable
Network.emulateNetworkConditions #
Activates emulation of network conditions.
Parameters
offline booleanTrue to emulate internet disconnection.
latency numberMinimum latency from request sent to response headers received (ms).
downloadThroughput numberMaximal aggregated download throughput (bytes/sec). -1 disables download throttling.
uploadThroughput numberMaximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
connectionTypeOptional
Connection type if known.
packetLossOptional
numberWebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
packetQueueLengthOptional
integerWebRTC packet queue length (packet). 0 removes any queue length limitations.
packetReorderingOptional
booleanWebRTC packetReordering feature.
Network.enable #
Enables network tracking, network events will now be delivered to the client.
Network.enable support is experimental.
Enable network debugging. Returns false if already enabled.
@cdp Network.enable
Parameters
maxTotalBufferSizeOptional
integerBuffer size in bytes to use when preserving network payloads (XHRs, etc).
maxResourceBufferSizeOptional
integerPer-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
maxPostDataSizeOptional
integerLongest post body size (in bytes) that would be included in requestWillBeSent notification
reportDirectSocketTrafficOptional
booleanWhether DirectSocket chunk send/receive events should be reported.
enableDurableMessagesOptional
booleanEnable storing response bodies outside of renderer, so that these survive a cross-process navigation. Requires maxTotalBufferSize to be set. Currently defaults to false.
Network.getCookies #
Returns all browser cookies for the current URL. Depending on the backend support, will return
detailed cookie information in the cookies field.
Parameters
urlsOptional
array[ string ]The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list containing the URLs of the page and all of its subframes.
Return object
cookies array[ Cookie ]Array of cookie objects.
Network.getRequestPostData #
Returns post data sent with the request. Returns an error when no data was sent with the request.
Parameters
requestId Identifier of the network request to get content for.
Return object
postData stringRequest body string, omitting files from multipart requests
Network.getResponseBody #
Returns content served for the given request.
Network.getResponseBody support is experimental.
Parameters
requestId Identifier of the network request to get content for.
Return object
body stringResponse body.
base64Encoded booleanTrue, if content was sent as base64.
Network.setBypassServiceWorker #
Toggles ignoring of service worker for each request.
Parameters
bypass booleanBypass service worker and load from network.
Network.setCacheDisabled #
Toggles ignoring cache for each request. If true, cache will not be used.
Parameters
cacheDisabled booleanCache disabled state.
Network.setCookie #
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
Parameters
name stringCookie name.
value stringCookie value.
urlOptional
stringThe request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
domainOptional
stringCookie domain.
pathOptional
stringCookie path.
secureOptional
booleanTrue if cookie is secure.
httpOnlyOptional
booleanTrue if cookie is http-only.
sameSiteOptional
Cookie SameSite type.
expiresOptional
Cookie expiration date, session cookie if not set
priorityOptional
samePartyOptional
booleanTrue if cookie is SameParty.
sourceSchemeOptional
sourcePortOptional
integerCookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
partitionKeyOptional
Cookie partition key. If not set, the cookie will be set as not partitioned.
Return object
success booleanAlways set to true. If an error occurs, the response indicates protocol error.
Network.setExtraHTTPHeaders #
Specifies whether to always send extra HTTP headers with the requests from this page.
Parameters
headers Map with extra HTTP headers.
Network.setUserAgentOverride #
Allows overriding user agent with the given string.
Parameters
userAgent stringUser agent to use.
acceptLanguageOptional
stringBrowser language to emulate.
platformOptional
stringThe platform navigator.platform should return.
userAgentMetadataOptional
To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
Events
Network.dataReceived #
Fired when data chunk was received over the network.
Network.dataReceived
Parameters
requestId Request identifier.
timestamp Timestamp.
dataLength integerData chunk length.
encodedDataLength integerActual bytes received (might be less than dataLength for compressed encodings).
dataOptional
stringData that was received. (Encoded as a base64 string when passed over JSON)
Network.eventSourceMessageReceived #
Fired when EventSource message is received.
Parameters
requestId Request identifier.
timestamp Timestamp.
eventName stringMessage type.
eventId stringMessage identifier.
data stringMessage content.
Network.loadingFailed #
Fired when HTTP request has failed to load.
Network.loadingFailed
Parameters
requestId Request identifier.
timestamp Timestamp.
type Resource type.
errorText stringError message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h
canceledOptional
booleanTrue if loading was canceled.
blockedReasonOptional
The reason why loading was blocked, if any.
corsErrorStatusOptional
The reason why loading was blocked by CORS, if any.
Network.loadingFinished #
Fired when HTTP request has finished loading.
Network.loadingFinished
Parameters
requestId Request identifier.
timestamp Timestamp.
encodedDataLength numberTotal number of bytes received for this request.
Network.requestServedFromCache #
Fired if request ended up loading from cache.
Parameters
requestId Request identifier.
Network.requestWillBeSent #
Fired when page is about to send HTTP request.
Network.requestWillBeSent
Parameters
requestId Request identifier.
loaderId Loader identifier. Empty string if the request is fetched from worker.
documentURL stringURL of the document this request is loaded for.
request Request data.
timestamp Timestamp.
wallTime Timestamp.
initiator Request initiator.
redirectHasExtraInfo booleanIn the case that redirectResponse is populated, this flag indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted for the request which was just redirected.
redirectResponseOptional
Redirect response data.
typeOptional
Type of this resource.
frameIdOptional
Frame identifier.
hasUserGestureOptional
booleanWhether the request is initiated by a user gesture. Defaults to false.
Network.responseReceived #
Fired when HTTP response is available.
Network.responseReceived
Parameters
requestId Request identifier.
loaderId Loader identifier. Empty string if the request is fetched from worker.
timestamp Timestamp.
type Resource type.
response Response data.
hasExtraInfo booleanIndicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted for this request.
frameIdOptional
Frame identifier.
Network.webSocketClosed #
Fired when WebSocket is closed.
Parameters
requestId Request identifier.
timestamp Timestamp.
Network.webSocketCreated #
Fired upon WebSocket creation.
Parameters
requestId Request identifier.
url stringWebSocket request URL.
initiatorOptional
Request initiator.
Network.webSocketFrameError #
Fired when WebSocket message error occurs.
Parameters
requestId Request identifier.
timestamp Timestamp.
errorMessage stringWebSocket error message.
Network.webSocketFrameReceived #
Fired when WebSocket message is received.
Parameters
requestId Request identifier.
timestamp Timestamp.
response WebSocket response data.
Network.webSocketFrameSent #
Fired when WebSocket message is sent.
Parameters
requestId Request identifier.
timestamp Timestamp.
response WebSocket response data.
Network.webSocketHandshakeResponseReceived #
Fired when WebSocket handshake response becomes available.
Parameters
requestId Request identifier.
timestamp Timestamp.
response WebSocket response data.
Network.webSocketWillSendHandshakeRequest #
Fired when WebSocket is about to initiate handshake.
Parameters
requestId Request identifier.
timestamp Timestamp.
wallTime UTC Timestamp.
request WebSocket request data.
Network.webTransportClosed #
Fired when WebTransport is disposed.
Parameters
transportId WebTransport identifier.
timestamp Timestamp.
Network.webTransportConnectionEstablished #
Fired when WebTransport handshake is finished.
Parameters
transportId WebTransport identifier.
timestamp Timestamp.
Network.webTransportCreated #
Fired upon WebTransport creation.
Parameters
transportId WebTransport identifier.
url stringWebTransport request URL.
timestamp Timestamp.
initiatorOptional
Request initiator.
Types
Network.BlockedReason #
The reason why request was blocked.
Type: string
Allowed values: other, csp, mixed-content, origin, inspector, integrity, subresource-filter, content-type, coep-frame-resource-needs-coep-header, coop-sandboxed-iframe-cannot-navigate-to-coop-page, corp-not-same-origin, corp-not-same-origin-after-defaulted-to-same-origin-by-coep, corp-not-same-origin-after-defaulted-to-same-origin-by-dip, corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip, corp-not-same-site, sri-message-signature-mismatch
Network.CachedResource #
Information about the cached resource.
Type: object
Properties
url stringResource URL. This is the url of the original network request.
type Type of this resource.
responseOptional
Cached response data.
bodySize numberCached response body size.
Network.CertificateTransparencyCompliance #
Whether the request complied with Certificate Transparency policy.
Type: string
Allowed values: unknown, not-compliant, compliant
Network.ConnectionType #
The underlying connection technology that the browser is supposedly using.
Type: string
Allowed values: none, cellular2g, cellular3g, cellular4g, bluetooth, ethernet, wifi, wimax, other
Network.Cookie #
Cookie object
Type: object
Properties
name stringCookie name.
value stringCookie value.
domain stringCookie domain.
path stringCookie path.
expires numberCookie expiration date as the number of seconds since the UNIX epoch. The value is set to -1 if the expiry date is not set. The value can be null for values that cannot be represented in JSON (±Inf).
size integerCookie size.
httpOnly booleanTrue if cookie is http-only.
secure booleanTrue if cookie is secure.
session booleanTrue in case of session cookie.
sameSiteOptional
Cookie SameSite type.
priority sameParty booleanTrue if cookie is SameParty.
sourceScheme sourcePort integerCookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
partitionKeyOptional
partitionKeyOpaqueOptional
booleanTrue if cookie partition key is opaque.
Network.CookieParam #
Cookie parameter object
Type: object
Properties
name stringCookie name.
value stringCookie value.
urlOptional
stringThe request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
domainOptional
stringCookie domain.
pathOptional
stringCookie path.
secureOptional
booleanTrue if cookie is secure.
httpOnlyOptional
booleanTrue if cookie is http-only.
sameSiteOptional
Cookie SameSite type.
expiresOptional
Cookie expiration date, session cookie if not set
priorityOptional
samePartyOptional
booleanTrue if cookie is SameParty.
sourceSchemeOptional
sourcePortOptional
integerCookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
partitionKeyOptional
Cookie partition key. If not set, the cookie will be set as not partitioned.
Network.CookieSameSite #
Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies
Type: string
Allowed values: Strict, Lax, None
Network.CorsError #
The reason why request was blocked.
Type: string
Allowed values: DisallowedByMode, InvalidResponse, WildcardOriginNotAllowed, MissingAllowOriginHeader, MultipleAllowOriginValues, InvalidAllowOriginValue, AllowOriginMismatch, InvalidAllowCredentials, CorsDisabledScheme, PreflightInvalidStatus, PreflightDisallowedRedirect, PreflightWildcardOriginNotAllowed, PreflightMissingAllowOriginHeader, PreflightMultipleAllowOriginValues, PreflightInvalidAllowOriginValue, PreflightAllowOriginMismatch, PreflightInvalidAllowCredentials, PreflightMissingAllowExternal, PreflightInvalidAllowExternal, PreflightMissingAllowPrivateNetwork, PreflightInvalidAllowPrivateNetwork, InvalidAllowMethodsPreflightResponse, InvalidAllowHeadersPreflightResponse, MethodDisallowedByPreflightResponse, HeaderDisallowedByPreflightResponse, RedirectContainsCredentials, InsecurePrivateNetwork, InvalidPrivateNetworkAccess, UnexpectedPrivateNetworkAccess, NoCorsRedirectModeNotFollow, PreflightMissingPrivateNetworkAccessId, PreflightMissingPrivateNetworkAccessName, PrivateNetworkAccessPermissionUnavailable, PrivateNetworkAccessPermissionDenied, LocalNetworkAccessPermissionDenied
Network.ErrorReason #
Network level fetch failure reason.
Type: string
Allowed values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
Network.Initiator #
Information about the request initiator.
Type: object
Properties
type stringType of this initiator.
Allowed values: parser, script, preload, SignedExchange, preflight, other
stackOptional
Initiator JavaScript stack trace, set for Script only. Requires the Debugger domain to be enabled.
urlOptional
stringInitiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
lineNumberOptional
numberInitiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
columnNumberOptional
numberInitiator column number, set for Parser type or for Script type (when script is importing module) (0-based).
requestIdOptional
Set if another request triggered this request (e.g. preflight).
Network.MonotonicTime #
Monotonically increasing time in seconds since an arbitrary point in the past.
Type: number
Network.Request #
HTTP request data.
Type: object
Properties
url stringRequest URL (without fragment).
urlFragmentOptional
stringFragment of the requested URL starting with hash, if present.
method stringHTTP request method.
headers HTTP request headers.
postDataOptional
stringHTTP POST request data. Use postDataEntries instead.
hasPostDataOptional
booleanTrue when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
postDataEntriesOptional
array[ PostDataEntry ]Request body elements (post data broken into individual entries).
mixedContentTypeOptional
The mixed content type of the request.
initialPriority Priority of the resource request at the time request is sent.
referrerPolicy stringThe referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
Allowed values: unsafe-url, no-referrer-when-downgrade, no-referrer, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin
isLinkPreloadOptional
booleanWhether is loaded via link preload.
trustTokenParamsOptional
Set for requests when the TrustToken API is used. Contains the parameters passed by the developer (e.g. via "fetch") as understood by the backend.
isSameSiteOptional
booleanTrue if this resource request is considered to be the 'same site' as the request corresponding to the main frame.
isAdRelatedOptional
booleanTrue when the resource request is ad-related.
Network.RequestId #
Unique network request identifier. Note that this does not identify individual HTTP requests that are part of a network request.
Type: string
Network.ResourcePriority #
Loading priority of a resource request.
Type: string
Allowed values: VeryLow, Low, Medium, High, VeryHigh
Network.ResourceTiming #
Timing information for the request.
Type: object
Properties
requestTime numberTiming's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
proxyStart numberStarted resolving proxy.
proxyEnd numberFinished resolving proxy.
dnsStart numberStarted DNS address resolve.
dnsEnd numberFinished DNS address resolve.
connectStart numberStarted connecting to the remote host.
connectEnd numberConnected to the remote host.
sslStart numberStarted SSL handshake.
sslEnd numberFinished SSL handshake.
workerStart numberStarted running ServiceWorker.
workerReady numberFinished Starting ServiceWorker.
workerFetchStart numberStarted fetch event.
workerRespondWithSettled numberSettled fetch event respondWith promise.
workerRouterEvaluationStartOptional
numberStarted ServiceWorker static routing source evaluation.
workerCacheLookupStartOptional
numberStarted cache lookup when the source was evaluated to cache.
sendStart numberStarted sending request.
sendEnd numberFinished sending request.
pushStart numberTime the server started pushing request.
pushEnd numberTime the server finished pushing request.
receiveHeadersStart numberStarted receiving response headers.
receiveHeadersEnd numberFinished receiving response headers.
Network.ResourceType #
Resource type as it was perceived by the rendering engine.
Type: string
Allowed values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, Prefetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Preflight, FedCM, Other
Network.Response #
HTTP response data.
Type: object
Properties
url stringResponse URL. This URL can be different from CachedResource.url in case of redirect.
status integerHTTP response status code.
statusText stringHTTP response status text.
headers HTTP response headers.
headersTextOptional
stringHTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.
mimeType stringResource mimeType as determined by the browser.
charset stringResource charset as determined by the browser (if applicable).
requestHeadersOptional
Refined HTTP request headers that were actually transmitted over the network.
requestHeadersTextOptional
stringHTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.
connectionReused booleanSpecifies whether physical connection was actually reused for this request.
connectionId numberPhysical connection id that was actually used for this request.
remoteIPAddressOptional
stringRemote IP address.
remotePortOptional
integerRemote port.
fromDiskCacheOptional
booleanSpecifies that the request was served from the disk cache.
fromServiceWorkerOptional
booleanSpecifies that the request was served from the ServiceWorker.
fromPrefetchCacheOptional
booleanSpecifies that the request was served from the prefetch cache.
fromEarlyHintsOptional
booleanSpecifies that the request was served from the prefetch cache.
serviceWorkerRouterInfoOptional
Information about how ServiceWorker Static Router API was used. If this
field is set with matchedSourceType field, a matching rule is found.
If this field is set without matchedSource, no matching rule is found.
Otherwise, the API is not used.
encodedDataLength numberTotal number of bytes received for this request so far.
timingOptional
Timing information for the given request.
serviceWorkerResponseSourceOptional
Response source of response from ServiceWorker.
responseTimeOptional
The time at which the returned response was generated.
cacheStorageCacheNameOptional
stringCache Storage Cache Name.
protocolOptional
stringProtocol used to fetch this request.
alternateProtocolUsageOptional
The reason why Chrome uses a specific transport protocol for HTTP semantics.
securityState Security state of the request resource.
securityDetailsOptional
Security details for the request.
isIpProtectionUsedOptional
booleanIndicates whether the request was sent through IP Protection proxies. If set to true, the request used the IP Protection privacy feature.
Network.SecurityDetails #
Security details about a request.
Type: object
Properties
protocol stringProtocol name (e.g. "TLS 1.2" or "QUIC").
keyExchange stringKey Exchange used by the connection, or the empty string if not applicable.
keyExchangeGroupOptional
string(EC)DH group used by the connection, if applicable.
cipher stringCipher name.
macOptional
stringTLS MAC. Note that AEAD ciphers do not have separate MACs.
certificateId Certificate ID value.
subjectName stringCertificate subject name.
sanList array[ string ]Subject Alternative Name (SAN) DNS names and IP addresses.
issuer stringName of the issuing CA.
validFrom Certificate valid from date.
validTo Certificate valid to (expiration) date
signedCertificateTimestampList array[ SignedCertificateTimestamp ]List of signed certificate timestamps (SCTs).
certificateTransparencyCompliance Whether the request complied with Certificate Transparency policy
serverSignatureAlgorithmOptional
integerThe signature algorithm used by the server in the TLS server signature, represented as a TLS SignatureScheme code point. Omitted if not applicable or not known.
encryptedClientHello booleanWhether the connection used Encrypted ClientHello
Network.ServiceWorkerResponseSource #
Source of serviceworker response.
Type: string
Allowed values: cache-storage, http-cache, fallback-code, network
Network.ServiceWorkerRouterSource #
Source of service worker router.
Type: string
Allowed values: network, cache, fetch-event, race-network-and-fetch-handler, race-network-and-cache
Network.SignedCertificateTimestamp #
Details of a signed certificate timestamp (SCT).
Type: object
Properties
status stringValidation status.
origin stringOrigin.
logDescription stringLog name / description.
logId stringLog ID.
timestamp numberIssuance date. Unlike TimeSinceEpoch, this contains the number of milliseconds since January 1, 1970, UTC, not the number of seconds.
hashAlgorithm stringHash algorithm.
signatureAlgorithm stringSignature algorithm.
signatureData stringSignature data.
Network.WebSocketFrame #
WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.
Type: object
Properties
opcode numberWebSocket message opcode.
mask booleanWebSocket message mask.
payloadData stringWebSocket message payload data. If the opcode is 1, this is a text message and payloadData is a UTF-8 string. If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.
Network.WebSocketRequest #
WebSocket request data.
Type: object
Properties
headers HTTP request headers.
Network.WebSocketResponse #
WebSocket response data.
Type: object
Properties
status integerHTTP response status code.
statusText stringHTTP response status text.
headers HTTP response headers.
headersTextOptional
stringHTTP response headers text.
requestHeadersOptional
HTTP request headers.
requestHeadersTextOptional
stringHTTP request headers text.