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

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.

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

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

Return Object
cookies
array[ Cookie ]

Array of cookie objects.

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.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 and path 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
Return Object
success
boolean

True if successfully set cookie.

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 langugage 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).

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

User friendly error message.

canceled
boolean

True if loading was canceled.

blockedReason
BlockedReason

The reason why loading was blocked, 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.

shouldReportCorbBlocking
boolean

Set when 1) response was blocked by Cross-Origin Read Blocking and also 2) this needs to be reported to the DevTools console.

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.

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.

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.

Types

Network.BlockedReason

The reason why request was blocked.

Allowed Values: other, csp, mixed-content, origin, inspector, subresource-filter, content-type, collapsed-by-client, 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-site

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

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 and path 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

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.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, other
stack
Runtime.StackTrace

Initiator JavaScript stack trace, set for Script only.

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

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.

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. This will be converted from base64 to binary

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.

Network.RequestId

Unique request identifier.

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
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
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, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, 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.

mimeType
string

Resource mimeType as determined by the browser.

requestHeaders
Headers

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

requestHeadersText
string

HTTP request headers text.

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.

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.

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

Network.ServiceWorkerResponseSource

Source of serviceworker response.

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

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
TimeSinceEpoch

Issuance date.

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.