Chrome DevTools Protocol

Methods

Network.clearBrowserCache

Clears browser cache.

Network.clearBrowserCookies

Clears browser cookies.

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
string

If specified, deletes all the cookies with the given name where domain and path match provided URL.

domain
string

If specified, deletes only cookies with the exact domain.

path
string

If specified, deletes only cookies with the exact path.

partitionKey
CookiePartitionKey

If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.

Experimental

Network.disable

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

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
ConnectionType

Connection type if known.

packetLoss
number

WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.

Experimental
packetQueueLength
integer

WebRTC packet queue length (packet). 0 removes any queue length limitations.

Experimental
packetReordering
boolean

WebRTC packetReordering feature.

Experimental

Network.enable

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

parameters
maxTotalBufferSize
integer

Buffer size in bytes to use when preserving network payloads (XHRs, etc).

Experimental
maxResourceBufferSize
integer

Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).

Experimental
maxPostDataSize
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
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
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
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
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
string

Cookie domain.

path
string

Cookie path.

secure
boolean

True if cookie is secure.

httpOnly
boolean

True if cookie is http-only.

sameSite
CookieSameSite

Cookie SameSite type.

expires
TimeSinceEpoch

Cookie expiration date, session cookie if not set

priority
CookiePriority

Cookie Priority type.

Experimental
sameParty
boolean

True if cookie is SameParty.

Experimental
sourceScheme
CookieSourceScheme

Cookie source scheme type.

Experimental
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.

Experimental
partitionKey
CookiePartitionKey

Cookie partition key. If not set, the cookie will be set as not partitioned.

Experimental
Return Object
success
boolean

Always set to true. If an error occurs, the response indicates protocol error.

Deprecated

Network.setCookies

Sets given cookies.

parameters
cookies
array[ CookieParam ]

Cookies to be set.

Network.setExtraHTTPHeaders

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

parameters
headers
Headers

Map with extra HTTP headers.

Network.setUserAgentOverride

Allows overriding user agent with the given string.

parameters
userAgent
string

User agent to use.

acceptLanguage
string

Browser language to emulate.

platform
string

The platform navigator.platform should return.

userAgentMetadata
Emulation.UserAgentMetadata

To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

Experimental

Events

Network.dataReceived

Fired when data chunk was received over the network.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

dataLength
integer

Data chunk length.

encodedDataLength
integer

Actual bytes received (might be less than dataLength for compressed encodings).

data
string

Data that was received. (Encoded as a base64 string when passed over JSON)

Experimental

Network.eventSourceMessageReceived

Fired when EventSource message is received.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

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
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

type
ResourceType

Resource type.

errorText
string
canceled
boolean

True if loading was canceled.

blockedReason
BlockedReason

The reason why loading was blocked, if any.

corsErrorStatus
CorsErrorStatus

The reason why loading was blocked by CORS, if any.

Network.loadingFinished

Fired when HTTP request has finished loading.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

encodedDataLength
number

Total number of bytes received for this request.

Network.requestServedFromCache

Fired if request ended up loading from cache.

parameters
requestId
RequestId

Request identifier.

Network.requestWillBeSent

Fired when page is about to send HTTP request.

parameters
requestId
RequestId

Request identifier.

loaderId
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

Request data.

timestamp
MonotonicTime

Timestamp.

wallTime
TimeSinceEpoch

Timestamp.

initiator
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.

Experimental
redirectResponse
Response

Redirect response data.

type
ResourceType

Type of this resource.

frameId
Page.FrameId

Frame identifier.

hasUserGesture
boolean

Whether the request is initiated by a user gesture. Defaults to false.

Network.responseReceived

Fired when HTTP response is available.

parameters
requestId
RequestId

Request identifier.

loaderId
LoaderId

Loader identifier. Empty string if the request is fetched from worker.

timestamp
MonotonicTime

Timestamp.

type
ResourceType

Resource type.

response
Response

Response data.

hasExtraInfo
boolean

Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted for this request.

Experimental
frameId
Page.FrameId

Frame identifier.

Network.webSocketClosed

Fired when WebSocket is closed.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

Network.webSocketCreated

Fired upon WebSocket creation.

parameters
requestId
RequestId

Request identifier.

url
string

WebSocket request URL.

initiator
Initiator

Request initiator.

Network.webSocketFrameError

Fired when WebSocket message error occurs.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

errorMessage
string

WebSocket error message.

Network.webSocketFrameReceived

Fired when WebSocket message is received.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

response
WebSocketFrame

WebSocket response data.

Network.webSocketFrameSent

Fired when WebSocket message is sent.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

response
WebSocketFrame

WebSocket response data.

Network.webSocketHandshakeResponseReceived

Fired when WebSocket handshake response becomes available.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

response
WebSocketResponse

WebSocket response data.

Network.webSocketWillSendHandshakeRequest

Fired when WebSocket is about to initiate handshake.

parameters
requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

wallTime
TimeSinceEpoch

UTC Timestamp.

request
WebSocketRequest

WebSocket request data.

Network.webTransportClosed

Fired when WebTransport is disposed.

parameters
transportId
RequestId

WebTransport identifier.

timestamp
MonotonicTime

Timestamp.

Network.webTransportConnectionEstablished

Fired when WebTransport handshake is finished.

parameters
transportId
RequestId

WebTransport identifier.

timestamp
MonotonicTime

Timestamp.

Network.webTransportCreated

Fired upon WebTransport creation.

parameters
transportId
RequestId

WebTransport identifier.

url
string

WebTransport request URL.

timestamp
MonotonicTime

Timestamp.

initiator
Initiator

Request initiator.

Types

Network.BlockedReason

The reason why request was blocked.

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, sri-message-signature-mismatch

Type: string

Network.CachedResource

Information about the cached resource.

Type: object

properties
url
string

Resource URL. This is the url of the original network request.

type
ResourceType

Type of this resource.

response
Response

Cached response data.

bodySize
number

Cached response body size.

Network.CertificateTransparencyCompliance

Whether the request complied with Certificate Transparency policy.

Allowed Values: unknown, not-compliant, compliant

Type: string

Network.ConnectionType

The underlying connection technology that the browser is supposedly using.

Allowed Values: none, cellular2g, cellular3g, cellular4g, bluetooth, ethernet, wifi, wimax, other

Type: string

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
CookieSameSite

Cookie SameSite type.

priority
CookiePriority

Cookie Priority

Experimental
sameParty
boolean

True if cookie is SameParty.

ExperimentalDeprecated
sourceScheme
CookieSourceScheme

Cookie source scheme type.

Experimental
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.

Experimental
partitionKey
CookiePartitionKey

Cookie partition key.

Experimental
partitionKeyOpaque
boolean

True if cookie partition key is opaque.

Experimental

Network.CookieParam

Cookie parameter object

Type: object

properties
name
string

Cookie name.

value
string

Cookie value.

url
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
string

Cookie domain.

path
string

Cookie path.

secure
boolean

True if cookie is secure.

httpOnly
boolean

True if cookie is http-only.

sameSite
CookieSameSite

Cookie SameSite type.

expires
TimeSinceEpoch

Cookie expiration date, session cookie if not set

priority
CookiePriority

Cookie Priority.

Experimental
sameParty
boolean

True if cookie is SameParty.

Experimental
sourceScheme
CookieSourceScheme

Cookie source scheme type.

Experimental
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.

Experimental
partitionKey
CookiePartitionKey

Cookie partition key. If not set, the cookie will be set as not partitioned.

Experimental

Network.CookieSameSite

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

Allowed Values: Strict, Lax, None

Type: string

Network.CorsError

The reason why request was blocked.

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

Type: string

Network.CorsErrorStatus

Type: object

properties
corsError
CorsError
failedParameter
string

Network.ErrorReason

Network level fetch failure reason.

Allowed Values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse

Type: string

Network.Headers

Request / response headers as keys / values of JSON object.

Type: object

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
Runtime.StackTrace

Initiator JavaScript stack trace, set for Script only. Requires the Debugger domain to be enabled.

url
string

Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.

lineNumber
number

Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).

columnNumber
number

Initiator column number, set for Parser type or for Script type (when script is importing module) (0-based).

requestId
RequestId

Set if another request triggered this request (e.g. preflight).

Network.InterceptionId

Unique intercepted request identifier.

Type: string

Network.LoaderId

Unique loader identifier.

Type: string

Network.MonotonicTime

Monotonically increasing time in seconds since an arbitrary point in the past.

Type: number

Network.PostDataEntry

Post data entry for HTTP request

Type: object

properties
bytes
string

Network.Request

HTTP request data.

Type: object

properties
url
string

Request URL (without fragment).

urlFragment
string

Fragment of the requested URL starting with hash, if present.

method
string

HTTP request method.

headers
Headers

HTTP request headers.

postData
string

HTTP POST request data. Use postDataEntries instead.

Deprecated
hasPostData
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
array[ PostDataEntry ]

Request body elements (post data broken into individual entries).

Experimental
mixedContentType
Security.MixedContentType

The mixed content type of the request.

initialPriority
ResourcePriority

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
boolean

Whether is loaded via link preload.

trustTokenParams
TrustTokenParams

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.

Experimental
isSameSite
boolean

True if this resource request is considered to be the 'same site' as the request corresponding to the main frame.

Experimental

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.

Allowed Values: VeryLow, Low, Medium, High, VeryHigh

Type: string

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.

Experimental
workerReady
number

Finished Starting ServiceWorker.

Experimental
workerFetchStart
number

Started fetch event.

Experimental
workerRespondWithSettled
number

Settled fetch event respondWith promise.

Experimental
workerRouterEvaluationStart
number

Started ServiceWorker static routing source evaluation.

Experimental
workerCacheLookupStart
number

Started cache lookup when the source was evaluated to cache.

Experimental
sendStart
number

Started sending request.

sendEnd
number

Finished sending request.

pushStart
number

Time the server started pushing request.

Experimental
pushEnd
number

Time the server finished pushing request.

Experimental
receiveHeadersStart
number

Started receiving response headers.

Experimental
receiveHeadersEnd
number

Finished receiving response headers.

Network.ResourceType

Resource type as it was perceived by the rendering engine.

Allowed Values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, Prefetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Preflight, Other

Type: string

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
Headers

HTTP response headers.

headersText
string

HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.

Deprecated
mimeType
string

Resource mimeType as determined by the browser.

charset
string

Resource charset as determined by the browser (if applicable).

requestHeaders
Headers

Refined HTTP request headers that were actually transmitted over the network.

requestHeadersText
string

HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.

Deprecated
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
string

Remote IP address.

remotePort
integer

Remote port.

fromDiskCache
boolean

Specifies that the request was served from the disk cache.

fromServiceWorker
boolean

Specifies that the request was served from the ServiceWorker.

fromPrefetchCache
boolean

Specifies that the request was served from the prefetch cache.

fromEarlyHints
boolean

Specifies that the request was served from the prefetch cache.

serviceWorkerRouterInfo
ServiceWorkerRouterInfo

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.

Experimental
encodedDataLength
number

Total number of bytes received for this request so far.

timing
ResourceTiming

Timing information for the given request.

serviceWorkerResponseSource
ServiceWorkerResponseSource

Response source of response from ServiceWorker.

responseTime
TimeSinceEpoch

The time at which the returned response was generated.

cacheStorageCacheName
string

Cache Storage Cache Name.

protocol
string

Protocol used to fetch this request.

alternateProtocolUsage
AlternateProtocolUsage

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

Experimental
securityState
Security.SecurityState

Security state of the request resource.

securityDetails
SecurityDetails

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
string

(EC)DH group used by the connection, if applicable.

cipher
string

Cipher name.

mac
string

TLS MAC. Note that AEAD ciphers do not have separate MACs.

certificateId
Security.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
TimeSinceEpoch

Certificate valid from date.

validTo
TimeSinceEpoch

Certificate valid to (expiration) date

signedCertificateTimestampList
array[ SignedCertificateTimestamp ]

List of signed certificate timestamps (SCTs).

certificateTransparencyCompliance
CertificateTransparencyCompliance

Whether the request complied with Certificate Transparency policy

serverSignatureAlgorithm
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.

Allowed Values: cache-storage, http-cache, fallback-code, network

Type: string

Network.ServiceWorkerRouterSource

Source of service worker router.

Allowed Values: network, cache, fetch-event, race-network-and-fetch-handler

Type: string

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.TimeSinceEpoch

UTC time in seconds, counted from January 1, 1970.

Type: number

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
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
Headers

HTTP response headers.

headersText
string

HTTP response headers text.

requestHeaders
Headers

HTTP request headers.

requestHeadersText
string

HTTP request headers text.