Chrome DevTools

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

Events

Types

Methods

React NativeChrome DevTools

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


React NativeChrome DevTools

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

maxTotalBufferSize
Optional
integer

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

Experimental
maxResourceBufferSize
Optional
integer

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

Experimental
maxPostDataSize
Optional
integer

Longest post body size (in bytes) that would be included in requestWillBeSent notification

reportDirectSocketTraffic
Optional
boolean

Whether DirectSocket chunk send/receive events should be reported.

Experimental
enableDurableMessages
Optional
boolean

Enable storing response bodies outside of renderer, so that these survive a cross-process navigation. Requires maxTotalBufferSize to be set. Currently defaults to false.

Experimental

React NativeChrome DevTools

Network.getResponseBody #

Returns content served for the given request.

Network.getResponseBody support is experimental.

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.


React NativeChrome DevTools

Network.loadNetworkResource Experimental#

Fetches the resource and returns the content.

Parameters

frameId
Optional
Page.FrameId

Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets.

url
string

URL of the resource to get content for.

options
LoadNetworkResourceOptions

Options for the request.

Return object

Events

React NativeChrome DevTools

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

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

Experimental

React NativeChrome DevTools

Network.loadingFailed #

Fired when HTTP request has failed to load.

Parameters

requestId
RequestId

Request identifier.

timestamp
MonotonicTime

Timestamp.

type
ResourceType

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
BlockedReason

The reason why loading was blocked, if any.

corsErrorStatus
Optional
CorsErrorStatus

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


React NativeChrome DevTools

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.


React NativeChrome DevTools

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
Optional
Response

Redirect response data.

type
Optional
ResourceType

Type of this resource.

frameId
Optional
Page.FrameId

Frame identifier.

hasUserGesture
Optional
boolean

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


React NativeChrome DevTools

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
Optional
Page.FrameId

Frame identifier.


React NativeChrome DevTools

Network.requestWillBeSentExtraInfo Experimental#

Fired when additional information about a requestWillBeSent event is available from the network stack. Not every requestWillBeSent event will have an additional requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will be fired first for the same request.

Network.requestWillBeSentExtraInfo

Parameters

requestId
RequestId

Request identifier. Used to match this information to an existing requestWillBeSent event.

associatedCookies
array[ AssociatedCookie ]

A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReasons field set.

headers
Headers

Raw request headers as they will be sent over the wire.

connectTiming
ConnectTiming

Connection timing information for the request.

Experimental
clientSecurityState
Optional
ClientSecurityState

The client security state set for the request.

siteHasCookieInOtherPartition
Optional
boolean

Whether the site has partitioned cookies stored in a partition different than the current one.

Types

Chrome DevTools

Network.Headers #

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

Type: object


Chrome DevTools

Network.LoaderId #

Unique loader identifier.

Type: string


Chrome DevTools

Network.RequestId #

Unique network request identifier. Note that this does not identify individual HTTP requests that are part of a network request.

Type: string