pl.wendigo.chrome.api.network / NetworkOperations

NetworkOperations

class NetworkOperations (source)

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.

Link
Protocol Network domain documentation.

Functions

canClearBrowserCache

fun canClearBrowserCache(): Single<CanClearBrowserCacheResponse>

Tells whether clearing browser cache is supported.

canClearBrowserCookies

fun canClearBrowserCookies(): Single<CanClearBrowserCookiesResponse>

Tells whether clearing browser cookies is supported.

canEmulateNetworkConditions

fun canEmulateNetworkConditions(): Single<CanEmulateNetworkConditionsResponse>

Tells whether emulation of network conditions is supported.

clearBrowserCache

fun clearBrowserCache(): Single<ResponseFrame>

Clears browser cache.

clearBrowserCookies

fun clearBrowserCookies(): Single<ResponseFrame>

Clears browser cookies.

continueInterceptedRequest

fun continueInterceptedRequest(input: ContinueInterceptedRequestRequest): Single<ResponseFrame>

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.

dataReceived

fun dataReceived(): Flowable<DataReceivedEvent>

Fired when data chunk was received over the network.

deleteCookies

fun deleteCookies(input: DeleteCookiesRequest): Single<ResponseFrame>

Deletes browser cookies with matching name and url or domain/path pair.

disable

fun disable(): Single<ResponseFrame>

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

emulateNetworkConditions

fun emulateNetworkConditions(input: EmulateNetworkConditionsRequest): Single<ResponseFrame>

Activates emulation of network conditions.

enable

fun enable(input: EnableRequest): Single<ResponseFrame>

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

events

fun events(): Flowable<Event>

Returns flowable capturing all Network domains events.

eventSourceMessageReceived

fun eventSourceMessageReceived(): Flowable<EventSourceMessageReceivedEvent>

Fired when EventSource message is received.

getAllCookies

fun getAllCookies(): Single<GetAllCookiesResponse>

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

getCertificate

fun getCertificate(input: GetCertificateRequest): Single<GetCertificateResponse>

Returns the DER-encoded certificate.

getCookies

fun getCookies(input: GetCookiesRequest): Single<GetCookiesResponse>

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

getRequestPostData

fun getRequestPostData(input: GetRequestPostDataRequest): Single<GetRequestPostDataResponse>

Returns post data sent with the request. Returns an error when no data was sent with the request.

getResponseBody

fun getResponseBody(input: GetResponseBodyRequest): Single<GetResponseBodyResponse>

Returns content served for the given request.

getResponseBodyForInterception

fun getResponseBodyForInterception(input: GetResponseBodyForInterceptionRequest): Single<GetResponseBodyForInterceptionResponse>

Returns content served for the given currently intercepted request.

loadingFailed

fun loadingFailed(): Flowable<LoadingFailedEvent>

Fired when HTTP request has failed to load.

loadingFinished

fun loadingFinished(): Flowable<LoadingFinishedEvent>

Fired when HTTP request has finished loading.

replayXHR

fun replayXHR(input: ReplayXHRRequest): Single<ResponseFrame>

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.

requestIntercepted

fun requestIntercepted(): Flowable<RequestInterceptedEvent>

Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. Deprecated, use Fetch.requestPaused instead.

requestServedFromCache

fun requestServedFromCache(): Flowable<RequestServedFromCacheEvent>

Fired if request ended up loading from cache.

requestWillBeSent

fun requestWillBeSent(): Flowable<RequestWillBeSentEvent>

Fired when page is about to send HTTP request.

requestWillBeSentExtraInfo

fun requestWillBeSentExtraInfo(): Flowable<RequestWillBeSentExtraInfoEvent>

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.

resourceChangedPriority

fun resourceChangedPriority(): Flowable<ResourceChangedPriorityEvent>

Fired when resource loading priority is changed

responseReceived

fun responseReceived(): Flowable<ResponseReceivedEvent>

Fired when HTTP response is available.

responseReceivedExtraInfo

fun responseReceivedExtraInfo(): Flowable<ResponseReceivedExtraInfoEvent>

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.

searchInResponseBody

fun searchInResponseBody(input: SearchInResponseBodyRequest): Single<SearchInResponseBodyResponse>

Searches for given string in response content.

setBlockedURLs

fun setBlockedURLs(input: SetBlockedURLsRequest): Single<ResponseFrame>

Blocks URLs from loading.

setBypassServiceWorker

fun setBypassServiceWorker(input: SetBypassServiceWorkerRequest): Single<ResponseFrame>

Toggles ignoring of service worker for each request.

setCacheDisabled

fun setCacheDisabled(input: SetCacheDisabledRequest): Single<ResponseFrame>

Toggles ignoring cache for each request. If true, cache will not be used.

setCookie

fun setCookie(input: SetCookieRequest): Single<SetCookieResponse>

Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

setCookies

fun setCookies(input: SetCookiesRequest): Single<ResponseFrame>

Sets given cookies.

setDataSizeLimitsForTest

fun setDataSizeLimitsForTest(input: SetDataSizeLimitsForTestRequest): Single<ResponseFrame>

For testing.

setExtraHTTPHeaders

fun setExtraHTTPHeaders(input: SetExtraHTTPHeadersRequest): Single<ResponseFrame>

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

setRequestInterception

fun setRequestInterception(input: SetRequestInterceptionRequest): Single<ResponseFrame>

Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.

setUserAgentOverride

fun setUserAgentOverride(input: SetUserAgentOverrideRequest): Single<ResponseFrame>

Allows overriding user agent with the given string.

signedExchangeReceived

fun signedExchangeReceived(): Flowable<SignedExchangeReceivedEvent>

Fired when a signed exchange was received over the network

takeResponseBodyForInterceptionAsStream

fun takeResponseBodyForInterceptionAsStream(input: TakeResponseBodyForInterceptionAsStreamRequest): Single<TakeResponseBodyForInterceptionAsStreamResponse>

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.

webSocketClosed

fun webSocketClosed(): Flowable<WebSocketClosedEvent>

Fired when WebSocket is closed.

webSocketCreated

fun webSocketCreated(): Flowable<WebSocketCreatedEvent>

Fired upon WebSocket creation.

webSocketFrameError

fun webSocketFrameError(): Flowable<WebSocketFrameErrorEvent>

Fired when WebSocket message error occurs.

webSocketFrameReceived

fun webSocketFrameReceived(): Flowable<WebSocketFrameReceivedEvent>

Fired when WebSocket message is received.

webSocketFrameSent

fun webSocketFrameSent(): Flowable<WebSocketFrameSentEvent>

Fired when WebSocket message is sent.

webSocketHandshakeResponseReceived

fun webSocketHandshakeResponseReceived(): Flowable<WebSocketHandshakeResponseReceivedEvent>

Fired when WebSocket handshake response becomes available.

webSocketWillSendHandshakeRequest

fun webSocketWillSendHandshakeRequest(): Flowable<WebSocketWillSendHandshakeRequestEvent>

Fired when WebSocket is about to initiate handshake.