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
enable#
Enables network tracking, network events will now be delivered to the client.
disable#
Disables network tracking, prevents network events from being sent to the client.
setUserAgentOverride#
Allows overriding user agent with the given string.
Parameters
- userAgent
- string User agent to use.
setExtraHTTPHeaders#
Specifies whether to always send extra HTTP headers with the requests from this page.
Parameters
- headers
- Headers Map with extra HTTP headers.
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.
removeBlockedURL#
Cancels blocking of a specific URL from loading.
Parameters
- url
- string URL to stop blocking.
replayXHR#
This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.
Parameters
- requestId
- RequestId Identifier of XHR to replay.
setMonitoringXHREnabled#
Toggles monitoring of XMLHttpRequest. If true
, console will receive messages upon each XHR issued.
Parameters
- enabled
- boolean Monitoring enabled state.
canClearBrowserCache#
Tells whether clearing browser cache is supported.
Return object
- result
- boolean True if browser cache can be cleared.
clearBrowserCache#
Clears browser cache.
canClearBrowserCookies#
Tells whether clearing browser cookies is supported.
Return object
- result
- boolean True if browser cookies can be cleared.
clearBrowserCookies#
Clears browser cookies.
getCookies#
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.
deleteCookie#
Deletes browser cookie with given name, domain and path.
Parameters
- cookieName
- string Name of the cookie to remove.
- url
- string URL to match cooke domain and path.
canEmulateNetworkConditions#
Tells whether emulation of network conditions is supported.
Return object
- result
- boolean True if emulation of network conditions is supported.
emulateNetworkConditions#
Activates emulation of network conditions.
Parameters
- offline
- boolean True to emulate internet disconnection.
- latency
- number Additional latency (ms).
- downloadThroughput
- number Maximal aggregated download throughput.
- uploadThroughput
- number Maximal aggregated upload throughput.
setCacheDisabled#
Toggles ignoring cache for each request. If true
, cache will not be used.
Parameters
- cacheDisabled
- boolean Cache disabled state.
setDataSizeLimitsForTest#
For testing.
Parameters
- maxTotalSize
- integer Maximum total buffer size.
- maxResourceSize
- integer Maximum per-resource size.
getCertificateDetails#
Returns details for the given certificate.
Parameters
- certificateId
- CertificateId ID of the certificate to get details for.
Return object
- result
- CertificateDetails Certificate details.
showCertificateViewer#
Displays native dialog with the certificate details.
Parameters
- certificateId
- CertificateId Certificate id.
Events
requestWillBeSent#
Fired when page is about to send HTTP request.
Parameters
- requestId
- RequestId Request identifier.
- frameId
- Page.FrameId Frame identifier.
- loaderId
- LoaderId Loader identifier.
- documentURL
- string URL of the document this request is loaded for.
- request
- Request Request data.
- timestamp
- Timestamp Timestamp.
- wallTime
- Timestamp UTC Timestamp.
- initiator
- Initiator Request initiator.
- redirectResponse
- Response Redirect response data.
- type
- Page.ResourceType Type of this resource.
requestServedFromCache#
Fired if request ended up loading from cache.
Parameters
- requestId
- RequestId Request identifier.
responseReceived#
Fired when HTTP response is available.
Parameters
- requestId
- RequestId Request identifier.
- frameId
- Page.FrameId Frame identifier.
- loaderId
- LoaderId Loader identifier.
- timestamp
- Timestamp Timestamp.
- type
- Page.ResourceType Resource type.
- response
- Response Response data.
loadingFailed#
Fired when HTTP request has failed to load.
Parameters
- requestId
- RequestId Request identifier.
- timestamp
- Timestamp Timestamp.
- type
- Page.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.
webSocketWillSendHandshakeRequest#
Fired when WebSocket is about to initiate handshake.
Parameters
- requestId
- RequestId Request identifier.
- timestamp
- Timestamp Timestamp.
- wallTime
- Timestamp UTC Timestamp.
- request
- WebSocketRequest WebSocket request data.
webSocketHandshakeResponseReceived#
Fired when WebSocket handshake response becomes available.
Parameters
- requestId
- RequestId Request identifier.
- timestamp
- Timestamp Timestamp.
- response
- WebSocketResponse WebSocket response data.
webSocketCreated#
Fired upon WebSocket creation.
Parameters
- requestId
- RequestId Request identifier.
- url
- string WebSocket request URL.
webSocketFrameReceived#
Fired when WebSocket frame is received.
Parameters
- requestId
- RequestId Request identifier.
- timestamp
- Timestamp Timestamp.
- response
- WebSocketFrame WebSocket response data.
webSocketFrameSent#
Fired when WebSocket frame is sent.
Parameters
- requestId
- RequestId Request identifier.
- timestamp
- Timestamp Timestamp.
- response
- WebSocketFrame WebSocket response data.
Types
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.
- sendStart
- number Started sending request.
- sendEnd
- number Finished sending request.
- receiveHeadersEnd
- number Finished receiving response headers.
ResourcePriority#
Loading priority of a resource request.
Type: string
Allowed values
VeryLow, Low, Medium, High, VeryHigh.
Request#
HTTP request data.
Type: object
Properties
- url
- string Request URL.
- method
- string HTTP request method.
- headers
- Headers HTTP request headers.
- postData
- string HTTP POST request data.
- mixedContentType
- string The mixed content status of the request, as defined in http://www.w3.org/TR/mixed-content/ Allowed values: blockable, optionally-blockable, none.
- initialPriority
- ResourcePriority Priority of the resource request at the time request is sent.
CertificateSubject#
Subject of a certificate.
Type: object
Properties
- name
- string Certificate subject name.
- sanDnsNames
- array [string] Subject Alternative Name (SAN) DNS names.
- sanIpAddresses
- array [string] Subject Alternative Name (SAN) IP addresses.
CertificateDetails#
Details about a request's certificate.
Type: object
Properties
- subject
- CertificateSubject Certificate subject.
- issuer
- string Name of the issuing CA.
- validFrom
- Timestamp Certificate valid from date.
- validTo
- Timestamp Certificate valid to (expiration) date
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.
- cipher
- string Cipher name.
- mac
- string TLS MAC. Note that AEAD ciphers do not have separate MACs.
- certificateId
- CertificateId Certificate ID value.
BlockedReason#
The reason why request was blocked.
Type: string
Allowed values
csp, mixed-content, origin, inspector, other.
Response#
HTTP response data.
Type: object
Properties
- url
- string Response URL. This URL can be different from CachedResource.url in case of redirect.
- status
- number 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.
- encodedDataLength
- number Total number of bytes received for this request so far.
- timing
- ResourceTiming Timing information for the given request.
- protocol
- string Protocol used to fetch this request.
- securityState
- Security.SecurityState Security state of the request resource.
- securityDetails
- SecurityDetails Security details for the request.
WebSocketRequest#
WebSocket request data.
Type: object
Properties
- headers
- Headers HTTP request headers.
WebSocketFrame#
WebSocket frame data.
Type: object
Properties
- opcode
- number WebSocket frame opcode.
- mask
- boolean WebSocke frame mask.
- payloadData
- string WebSocke frame payload data.
CachedResource#
Information about the cached resource.
Type: object
Properties
- url
- string Resource URL. This is the url of the original network request.
- type
- Page.ResourceType Type of this resource.
- response
- Response Cached response data.
- bodySize
- number Cached response body size.
Initiator#
Information about the request initiator.
Type: object
Properties
- type
- string Type of this initiator. Allowed values: parser, script, other.
- stackTrace
- Console.StackTrace Initiator JavaScript stack trace, set for Script only.
- url
- string Initiator URL, set for Parser type only.
- lineNumber
- number Initiator line number, set for Parser type only.
- asyncStackTrace
- Console.AsyncStackTrace Initiator asynchronous JavaScript stack trace, if available.
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 expires.
- 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.