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
string
Name of the cookies to remove.
url
Optional
string
If specified, deletes all the cookies with the given name where domain and path match provided URL.
domain
Optional
string
If specified, deletes only cookies with the exact domain.
path
Optional
string
If specified, deletes only cookies with the exact path.
partitionKey
Optional
If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.
Network.emulateNetworkConditions #
Activates emulation of network conditions.
Parameters
offline
boolean
True to emulate internet disconnection.
latency
number
Minimum latency from request sent to response headers received (ms).
downloadThroughput
number
Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
uploadThroughput
number
Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
connectionType
Optional
Connection type if known.
packetLoss
Optional
number
WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
packetQueueLength
Optional
integer
WebRTC packet queue length (packet). 0 removes any queue length limitations.
packetReordering
Optional
boolean
WebRTC packetReordering feature.
Network.enable #
Enables network tracking, network events will now be delivered to the client.
Parameters
maxTotalBufferSize
Optional
integer
Buffer size in bytes to use when preserving network payloads (XHRs, etc).
maxResourceBufferSize
Optional
integer
Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
maxPostDataSize
Optional
integer
Longest post body size (in bytes) that would be included in requestWillBeSent notification
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
urls
Optional
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
string
Request body string, omitting files from multipart requests
Network.getResponseBody #
Returns content served for the given request.
Parameters
requestId
Identifier of the network request to get content for.
Return object
body
string
Response body.
base64Encoded
boolean
True, if content was sent as base64.
Network.setBypassServiceWorker #
Toggles ignoring of service worker for each request.
Parameters
bypass
boolean
Bypass service worker and load from network.
Network.setCacheDisabled #
Toggles ignoring cache for each request. If true
, cache will not be used.
Parameters
cacheDisabled
boolean
Cache disabled state.
Network.setCookie #
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
Parameters
name
string
Cookie name.
value
string
Cookie value.
url
Optional
string
The 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.
domain
Optional
string
Cookie domain.
path
Optional
string
Cookie path.
secure
Optional
boolean
True if cookie is secure.
httpOnly
Optional
boolean
True if cookie is http-only.
sameSite
Optional
Cookie SameSite type.
expires
Optional
Cookie expiration date, session cookie if not set
priority
Optional
sameParty
Optional
boolean
True if cookie is SameParty.
sourceScheme
Optional
sourcePort
Optional
integer
Cookie 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.
partitionKey
Optional
Cookie partition key. If not set, the cookie will be set as not partitioned.
Return object
success
boolean
Always 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
string
User agent to use.
acceptLanguage
Optional
string
Browser language to emulate.
platform
Optional
string
The platform navigator.platform should return.
userAgentMetadata
Optional
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.
Parameters
requestId
Request identifier.
timestamp
Timestamp.
dataLength
integer
Data chunk length.
encodedDataLength
integer
Actual bytes received (might be less than dataLength for compressed encodings).
data
Optional
string
Data 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
string
Message type.
eventId
string
Message identifier.
data
string
Message content.
Network.loadingFailed #
Fired when HTTP request has failed to load.
Parameters
requestId
Request identifier.
timestamp
Timestamp.
type
Resource type.
errorText
string
Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h
canceled
Optional
boolean
True if loading was canceled.
blockedReason
Optional
The reason why loading was blocked, if any.
corsErrorStatus
Optional
The reason why loading was blocked by CORS, if any.
Network.loadingFinished #
Fired when HTTP request has finished loading.
Parameters
requestId
Request identifier.
timestamp
Timestamp.
encodedDataLength
number
Total 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.
Parameters
requestId
Request identifier.
loaderId
Loader identifier. Empty string if the request is fetched from worker.
documentURL
string
URL of the document this request is loaded for.
request
Request data.
timestamp
Timestamp.
wallTime
Timestamp.
initiator
Request initiator.
redirectHasExtraInfo
boolean
In 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.
redirectResponse
Optional
Redirect response data.
type
Optional
Type of this resource.
frameId
Optional
Frame identifier.
hasUserGesture
Optional
boolean
Whether the request is initiated by a user gesture. Defaults to false.
Network.responseReceived #
Fired when HTTP response is available.
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
boolean
Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted for this request.
frameId
Optional
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
string
WebSocket request URL.
initiator
Optional
Request initiator.
Network.webSocketFrameError #
Fired when WebSocket message error occurs.
Parameters
requestId
Request identifier.
timestamp
Timestamp.
errorMessage
string
WebSocket 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
string
WebTransport request URL.
timestamp
Timestamp.
initiator
Optional
Request initiator.
Types
Network.BlockedReason #
The reason why request was blocked.
Type: string
Allowed values: other
, csp
, mixed-content
, origin
, inspector
, 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
Network.CachedResource #
Information about the cached resource.
Type: object
Properties
url
string
Resource URL. This is the url of the original network request.
type
Type of this resource.
response
Optional
Cached response data.
bodySize
number
Cached 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
string
Cookie name.
value
string
Cookie value.
domain
string
Cookie domain.
path
string
Cookie path.
expires
number
Cookie expiration date as the number of seconds since the UNIX epoch.
size
integer
Cookie size.
httpOnly
boolean
True if cookie is http-only.
secure
boolean
True if cookie is secure.
session
boolean
True in case of session cookie.
sameSite
Optional
Cookie SameSite type.
priority
sameParty
boolean
True if cookie is SameParty.
sourceScheme
sourcePort
integer
Cookie 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.
partitionKey
Optional
partitionKeyOpaque
Optional
boolean
True if cookie partition key is opaque.
Network.CookieParam #
Cookie parameter object
Type: object
Properties
name
string
Cookie name.
value
string
Cookie value.
url
Optional
string
The 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.
domain
Optional
string
Cookie domain.
path
Optional
string
Cookie path.
secure
Optional
boolean
True if cookie is secure.
httpOnly
Optional
boolean
True if cookie is http-only.
sameSite
Optional
Cookie SameSite type.
expires
Optional
Cookie expiration date, session cookie if not set
priority
Optional
sameParty
Optional
boolean
True if cookie is SameParty.
sourceScheme
Optional
sourcePort
Optional
integer
Cookie 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.
partitionKey
Optional
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
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
string
Type of this initiator.
Allowed values: parser
, script
, preload
, SignedExchange
, preflight
, other
stack
Optional
Initiator JavaScript stack trace, set for Script only.
url
Optional
string
Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
lineNumber
Optional
number
Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
columnNumber
Optional
number
Initiator column number, set for Parser type or for Script type (when script is importing module) (0-based).
requestId
Optional
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
string
Request URL (without fragment).
urlFragment
Optional
string
Fragment of the requested URL starting with hash, if present.
method
string
HTTP request method.
headers
HTTP request headers.
postData
Optional
string
HTTP POST request data. Use postDataEntries instead.
hasPostData
Optional
boolean
True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
postDataEntries
Optional
array[ PostDataEntry ]
Request body elements (post data broken into individual entries).
mixedContentType
Optional
The mixed content type of the request.
initialPriority
Priority of the resource request at the time request is sent.
referrerPolicy
string
The 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
isLinkPreload
Optional
boolean
Whether is loaded via link preload.
trustTokenParams
Optional
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.
isSameSite
Optional
boolean
True if this resource request is considered to be the 'same site' as the request corresponding to the main frame.
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
number
Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
proxyStart
number
Started resolving proxy.
proxyEnd
number
Finished resolving proxy.
dnsStart
number
Started DNS address resolve.
dnsEnd
number
Finished DNS address resolve.
connectStart
number
Started connecting to the remote host.
connectEnd
number
Connected to the remote host.
sslStart
number
Started SSL handshake.
sslEnd
number
Finished SSL handshake.
workerStart
number
Started running ServiceWorker.
workerReady
number
Finished Starting ServiceWorker.
workerFetchStart
number
Started fetch event.
workerRespondWithSettled
number
Settled fetch event respondWith promise.
workerRouterEvaluationStart
Optional
number
Started ServiceWorker static routing source evaluation.
workerCacheLookupStart
Optional
number
Started cache lookup when the source was evaluated to cache
.
sendStart
number
Started sending request.
sendEnd
number
Finished sending request.
pushStart
number
Time the server started pushing request.
pushEnd
number
Time the server finished pushing request.
receiveHeadersStart
number
Started receiving response headers.
receiveHeadersEnd
number
Finished 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
, Other
Network.Response #
HTTP response data.
Type: object
Properties
url
string
Response URL. This URL can be different from CachedResource.url in case of redirect.
status
integer
HTTP response status code.
statusText
string
HTTP response status text.
headers
HTTP response headers.
headersText
Optional
string
HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.
mimeType
string
Resource mimeType as determined by the browser.
charset
string
Resource charset as determined by the browser (if applicable).
requestHeaders
Optional
Refined HTTP request headers that were actually transmitted over the network.
requestHeadersText
Optional
string
HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.
connectionReused
boolean
Specifies whether physical connection was actually reused for this request.
connectionId
number
Physical connection id that was actually used for this request.
remoteIPAddress
Optional
string
Remote IP address.
remotePort
Optional
integer
Remote port.
fromDiskCache
Optional
boolean
Specifies that the request was served from the disk cache.
fromServiceWorker
Optional
boolean
Specifies that the request was served from the ServiceWorker.
fromPrefetchCache
Optional
boolean
Specifies that the request was served from the prefetch cache.
fromEarlyHints
Optional
boolean
Specifies that the request was served from the prefetch cache.
serviceWorkerRouterInfo
Optional
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
number
Total number of bytes received for this request so far.
timing
Optional
Timing information for the given request.
serviceWorkerResponseSource
Optional
Response source of response from ServiceWorker.
responseTime
Optional
The time at which the returned response was generated.
cacheStorageCacheName
Optional
string
Cache Storage Cache Name.
protocol
Optional
string
Protocol used to fetch this request.
alternateProtocolUsage
Optional
The reason why Chrome uses a specific transport protocol for HTTP semantics.
securityState
Security state of the request resource.
securityDetails
Optional
Security details for the request.
Network.SecurityDetails #
Security details about a request.
Type: object
Properties
protocol
string
Protocol name (e.g. "TLS 1.2" or "QUIC").
keyExchange
string
Key Exchange used by the connection, or the empty string if not applicable.
keyExchangeGroup
Optional
string
(EC)DH group used by the connection, if applicable.
cipher
string
Cipher name.
mac
Optional
string
TLS MAC. Note that AEAD ciphers do not have separate MACs.
certificateId
Certificate ID value.
subjectName
string
Certificate subject name.
sanList
array[ string
]
Subject Alternative Name (SAN) DNS names and IP addresses.
issuer
string
Name 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
serverSignatureAlgorithm
Optional
integer
The 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
boolean
Whether 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
Network.SignedCertificateTimestamp #
Details of a signed certificate timestamp (SCT).
Type: object
Properties
status
string
Validation status.
origin
string
Origin.
logDescription
string
Log name / description.
logId
string
Log ID.
timestamp
number
Issuance date. Unlike TimeSinceEpoch, this contains the number of milliseconds since January 1, 1970, UTC, not the number of seconds.
hashAlgorithm
string
Hash algorithm.
signatureAlgorithm
string
Signature algorithm.
signatureData
string
Signature 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
number
WebSocket message opcode.
mask
boolean
WebSocket message mask.
payloadData
string
WebSocket 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
integer
HTTP response status code.
statusText
string
HTTP response status text.
headers
HTTP response headers.
headersText
Optional
string
HTTP response headers text.
requestHeaders
Optional
HTTP request headers.
requestHeadersText
Optional
string
HTTP request headers text.