-
public final class NetworkDomainNetwork 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.
-
-
Method Summary
Modifier and Type Method Description final Flow<NetworkEvent>events()Subscribes to all events related to this domain. final Flow<NetworkEvent.DataReceivedEvent>dataReceived()Fired when data chunk was received over the network. final Flow<NetworkEvent.EventSourceMessageReceivedEvent>eventSourceMessageReceived()Fired when EventSource message is received. final Flow<NetworkEvent.LoadingFailedEvent>loadingFailed()Fired when HTTP request has failed to load. final Flow<NetworkEvent.LoadingFinishedEvent>loadingFinished()Fired when HTTP request has finished loading. final Flow<NetworkEvent.RequestInterceptedEvent>requestIntercepted()Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. final Flow<NetworkEvent.RequestServedFromCacheEvent>requestServedFromCache()Fired if request ended up loading from cache. final Flow<NetworkEvent.RequestWillBeSentEvent>requestWillBeSent()Fired when page is about to send HTTP request. final Flow<NetworkEvent.ResourceChangedPriorityEvent>resourceChangedPriority()Fired when resource loading priority is changedOfficial doc final Flow<NetworkEvent.SignedExchangeReceivedEvent>signedExchangeReceived()Fired when a signed exchange was received over the networkOfficial doc final Flow<NetworkEvent.ResponseReceivedEvent>responseReceived()Fired when HTTP response is available. final Flow<NetworkEvent.WebSocketClosedEvent>webSocketClosed()Fired when WebSocket is closed. final Flow<NetworkEvent.WebSocketCreatedEvent>webSocketCreated()Fired upon WebSocket creation. final Flow<NetworkEvent.WebSocketFrameErrorEvent>webSocketFrameError()Fired when WebSocket message error occurs. final Flow<NetworkEvent.WebSocketFrameReceivedEvent>webSocketFrameReceived()Fired when WebSocket message is received. final Flow<NetworkEvent.WebSocketFrameSentEvent>webSocketFrameSent()Fired when WebSocket message is sent. final Flow<NetworkEvent.WebSocketHandshakeResponseReceivedEvent>webSocketHandshakeResponseReceived()Fired when WebSocket handshake response becomes available. final Flow<NetworkEvent.WebSocketWillSendHandshakeRequestEvent>webSocketWillSendHandshakeRequest()Fired when WebSocket is about to initiate handshake. final Flow<NetworkEvent.WebTransportCreatedEvent>webTransportCreated()Fired upon WebTransport creation. final Flow<NetworkEvent.WebTransportClosedEvent>webTransportClosed()Official doc final Flow<NetworkEvent.RequestWillBeSentExtraInfoEvent>requestWillBeSentExtraInfo()Fired when additional information about a requestWillBeSent event is available from the network stack. final Flow<NetworkEvent.ResponseReceivedExtraInfoEvent>responseReceivedExtraInfo()Fired when additional information about a responseReceived event is available from the network stack. final Flow<NetworkEvent.TrustTokenOperationDoneEvent>trustTokenOperationDone()Fired exactly once for each Trust Token operation. final CanClearBrowserCacheResponsecanClearBrowserCache()Tells whether clearing browser cache is supported. final CanClearBrowserCookiesResponsecanClearBrowserCookies()Tells whether clearing browser cookies is supported. final CanEmulateNetworkConditionsResponsecanEmulateNetworkConditions()Tells whether emulation of network conditions is supported. final UnitclearBrowserCache()Clears browser cache. final UnitclearBrowserCookies()Clears browser cookies. final UnitcontinueInterceptedRequest(ContinueInterceptedRequestRequest input)Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. final UnitdeleteCookies(DeleteCookiesRequest input)Deletes browser cookies with matching name and url or domain/path pair. final Unitdisable()Disables network tracking, prevents network events from being sent to the client. final UnitemulateNetworkConditions(EmulateNetworkConditionsRequest input)Activates emulation of network conditions. final Unitenable(EnableRequest input)Enables network tracking, network events will now be delivered to the client. final GetAllCookiesResponsegetAllCookies()Returns all browser cookies. final GetCertificateResponsegetCertificate(GetCertificateRequest input)Returns the DER-encoded certificate. final GetCookiesResponsegetCookies(GetCookiesRequest input)Returns all browser cookies for the current URL. final GetResponseBodyResponsegetResponseBody(GetResponseBodyRequest input)Returns content served for the given request. final GetRequestPostDataResponsegetRequestPostData(GetRequestPostDataRequest input)Returns post data sent with the request. final GetResponseBodyForInterceptionResponsegetResponseBodyForInterception(GetResponseBodyForInterceptionRequest input)Returns content served for the given currently intercepted request. final TakeResponseBodyForInterceptionAsStreamResponsetakeResponseBodyForInterceptionAsStream(TakeResponseBodyForInterceptionAsStreamRequest input)Returns a handle to the stream representing the response body. final UnitreplayXHR(ReplayXHRRequest input)This method sends a new XMLHttpRequest which is identical to the original one. final SearchInResponseBodyResponsesearchInResponseBody(SearchInResponseBodyRequest input)Searches for given string in response content. final UnitsetBlockedURLs(SetBlockedURLsRequest input)Blocks URLs from loading. final UnitsetBypassServiceWorker(SetBypassServiceWorkerRequest input)Toggles ignoring of service worker for each request. final UnitsetCacheDisabled(SetCacheDisabledRequest input)Toggles ignoring cache for each request. final SetCookieResponsesetCookie(SetCookieRequest input)Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. final UnitsetCookies(SetCookiesRequest input)Sets given cookies. final UnitsetDataSizeLimitsForTest(SetDataSizeLimitsForTestRequest input)For testing. final UnitsetExtraHTTPHeaders(SetExtraHTTPHeadersRequest input)Specifies whether to always send extra HTTP headers with the requests from this page. final UnitsetAttachDebugStack(SetAttachDebugStackRequest input)Specifies whether to attach a page script stack id in requestsOfficial doc final UnitsetRequestInterception(SetRequestInterceptionRequest input)Sets the requests to intercept that match the provided patterns and optionally resource types. final UnitsetUserAgentOverride(SetUserAgentOverrideRequest input)Allows overriding user agent with the given string. final GetSecurityIsolationStatusResponsegetSecurityIsolationStatus(GetSecurityIsolationStatusRequest input)Returns information about the COEP/COOP isolation status. final LoadNetworkResourceResponseloadNetworkResource(LoadNetworkResourceRequest input)Fetches the resource and returns the content. -
-
Method Detail
-
events
final Flow<NetworkEvent> events()
Subscribes to all events related to this domain.
-
dataReceived
final Flow<NetworkEvent.DataReceivedEvent> dataReceived()
Fired when data chunk was received over the network.
-
eventSourceMessageReceived
final Flow<NetworkEvent.EventSourceMessageReceivedEvent> eventSourceMessageReceived()
Fired when EventSource message is received.
-
loadingFailed
final Flow<NetworkEvent.LoadingFailedEvent> loadingFailed()
Fired when HTTP request has failed to load.
-
loadingFinished
final Flow<NetworkEvent.LoadingFinishedEvent> loadingFinished()
Fired when HTTP request has finished loading.
-
requestIntercepted
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final Flow<NetworkEvent.RequestInterceptedEvent> requestIntercepted()
Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. Deprecated, use Fetch.requestPaused instead.
-
requestServedFromCache
final Flow<NetworkEvent.RequestServedFromCacheEvent> requestServedFromCache()
Fired if request ended up loading from cache.
-
requestWillBeSent
final Flow<NetworkEvent.RequestWillBeSentEvent> requestWillBeSent()
Fired when page is about to send HTTP request.
-
resourceChangedPriority
final Flow<NetworkEvent.ResourceChangedPriorityEvent> resourceChangedPriority()
Fired when resource loading priority is changed
-
signedExchangeReceived
final Flow<NetworkEvent.SignedExchangeReceivedEvent> signedExchangeReceived()
Fired when a signed exchange was received over the network
-
responseReceived
final Flow<NetworkEvent.ResponseReceivedEvent> responseReceived()
Fired when HTTP response is available.
-
webSocketClosed
final Flow<NetworkEvent.WebSocketClosedEvent> webSocketClosed()
Fired when WebSocket is closed.
-
webSocketCreated
final Flow<NetworkEvent.WebSocketCreatedEvent> webSocketCreated()
Fired upon WebSocket creation.
-
webSocketFrameError
final Flow<NetworkEvent.WebSocketFrameErrorEvent> webSocketFrameError()
Fired when WebSocket message error occurs.
-
webSocketFrameReceived
final Flow<NetworkEvent.WebSocketFrameReceivedEvent> webSocketFrameReceived()
Fired when WebSocket message is received.
-
webSocketFrameSent
final Flow<NetworkEvent.WebSocketFrameSentEvent> webSocketFrameSent()
Fired when WebSocket message is sent.
-
webSocketHandshakeResponseReceived
final Flow<NetworkEvent.WebSocketHandshakeResponseReceivedEvent> webSocketHandshakeResponseReceived()
Fired when WebSocket handshake response becomes available.
-
webSocketWillSendHandshakeRequest
final Flow<NetworkEvent.WebSocketWillSendHandshakeRequestEvent> webSocketWillSendHandshakeRequest()
Fired when WebSocket is about to initiate handshake.
-
webTransportCreated
final Flow<NetworkEvent.WebTransportCreatedEvent> webTransportCreated()
Fired upon WebTransport creation.
-
webTransportClosed
final Flow<NetworkEvent.WebTransportClosedEvent> webTransportClosed()
-
requestWillBeSentExtraInfo
final Flow<NetworkEvent.RequestWillBeSentExtraInfoEvent> requestWillBeSentExtraInfo()
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.
-
responseReceivedExtraInfo
final Flow<NetworkEvent.ResponseReceivedExtraInfoEvent> responseReceivedExtraInfo()
Fired when additional information about a responseReceived event is available from the network stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for it, and responseReceivedExtraInfo may be fired before or after responseReceived.
-
trustTokenOperationDone
final Flow<NetworkEvent.TrustTokenOperationDoneEvent> trustTokenOperationDone()
Fired exactly once for each Trust Token operation. Depending on the type of the operation and whether the operation succeeded or failed, the event is fired before the corresponding request was sent or after the response was received.
-
canClearBrowserCache
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final CanClearBrowserCacheResponse canClearBrowserCache()
Tells whether clearing browser cache is supported.
-
canClearBrowserCookies
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final CanClearBrowserCookiesResponse canClearBrowserCookies()
Tells whether clearing browser cookies is supported.
-
canEmulateNetworkConditions
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final CanEmulateNetworkConditionsResponse canEmulateNetworkConditions()
Tells whether emulation of network conditions is supported.
-
clearBrowserCache
final Unit clearBrowserCache()
Clears browser cache.
-
clearBrowserCookies
final Unit clearBrowserCookies()
Clears browser cookies.
-
continueInterceptedRequest
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final Unit continueInterceptedRequest(ContinueInterceptedRequestRequest input)
Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.
-
deleteCookies
final Unit deleteCookies(DeleteCookiesRequest input)
Deletes browser cookies with matching name and url or domain/path pair.
-
disable
final Unit disable()
Disables network tracking, prevents network events from being sent to the client.
-
emulateNetworkConditions
final Unit emulateNetworkConditions(EmulateNetworkConditionsRequest input)
Activates emulation of network conditions.
-
enable
final Unit enable(EnableRequest input)
Enables network tracking, network events will now be delivered to the client.
-
getAllCookies
final GetAllCookiesResponse getAllCookies()
Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the
cookiesfield.
-
getCertificate
final GetCertificateResponse getCertificate(GetCertificateRequest input)
Returns the DER-encoded certificate.
-
getCookies
final GetCookiesResponse getCookies(GetCookiesRequest input)
Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the
cookiesfield.
-
getResponseBody
final GetResponseBodyResponse getResponseBody(GetResponseBodyRequest input)
Returns content served for the given request.
-
getRequestPostData
final GetRequestPostDataResponse getRequestPostData(GetRequestPostDataRequest input)
Returns post data sent with the request. Returns an error when no data was sent with the request.
-
getResponseBodyForInterception
final GetResponseBodyForInterceptionResponse getResponseBodyForInterception(GetResponseBodyForInterceptionRequest input)
Returns content served for the given currently intercepted request.
-
takeResponseBodyForInterceptionAsStream
final TakeResponseBodyForInterceptionAsStreamResponse takeResponseBodyForInterceptionAsStream(TakeResponseBodyForInterceptionAsStreamRequest input)
Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.
-
replayXHR
final Unit replayXHR(ReplayXHRRequest input)
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.
-
searchInResponseBody
final SearchInResponseBodyResponse searchInResponseBody(SearchInResponseBodyRequest input)
Searches for given string in response content.
-
setBlockedURLs
final Unit setBlockedURLs(SetBlockedURLsRequest input)
Blocks URLs from loading.
-
setBypassServiceWorker
final Unit setBypassServiceWorker(SetBypassServiceWorkerRequest input)
Toggles ignoring of service worker for each request.
-
setCacheDisabled
final Unit setCacheDisabled(SetCacheDisabledRequest input)
Toggles ignoring cache for each request. If
true, cache will not be used.
-
setCookie
final SetCookieResponse setCookie(SetCookieRequest input)
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
-
setCookies
final Unit setCookies(SetCookiesRequest input)
Sets given cookies.
-
setDataSizeLimitsForTest
final Unit setDataSizeLimitsForTest(SetDataSizeLimitsForTestRequest input)
For testing.
-
setExtraHTTPHeaders
final Unit setExtraHTTPHeaders(SetExtraHTTPHeadersRequest input)
Specifies whether to always send extra HTTP headers with the requests from this page.
-
setAttachDebugStack
final Unit setAttachDebugStack(SetAttachDebugStackRequest input)
Specifies whether to attach a page script stack id in requests
-
setRequestInterception
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final Unit setRequestInterception(SetRequestInterceptionRequest input)
Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
-
setUserAgentOverride
final Unit setUserAgentOverride(SetUserAgentOverrideRequest input)
Allows overriding user agent with the given string.
-
getSecurityIsolationStatus
final GetSecurityIsolationStatusResponse getSecurityIsolationStatus(GetSecurityIsolationStatusRequest input)
Returns information about the COEP/COOP isolation status.
-
loadNetworkResource
final LoadNetworkResourceResponse loadNetworkResource(LoadNetworkResourceRequest input)
Fetches the resource and returns the content.
-
-
-
-