clj-chrome-devtools.commands.network
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.
can-clear-browser-cache
(can-clear-browser-cache)
(can-clear-browser-cache {:as params, :keys []})
(can-clear-browser-cache connection {:as params, :keys []})
Tells whether clearing browser cache is supported.
Return map keys:
Key | Description |
---|---|
:result | True if browser cache can be cleared. |
can-clear-browser-cookies
(can-clear-browser-cookies)
(can-clear-browser-cookies {:as params, :keys []})
(can-clear-browser-cookies connection {:as params, :keys []})
Tells whether clearing browser cookies is supported.
Return map keys:
Key | Description |
---|---|
:result | True if browser cookies can be cleared. |
can-emulate-network-conditions
(can-emulate-network-conditions)
(can-emulate-network-conditions {:as params, :keys []})
(can-emulate-network-conditions connection {:as params, :keys []})
Tells whether emulation of network conditions is supported.
Return map keys:
Key | Description |
---|---|
:result | True if emulation of network conditions is supported. |
clear-accepted-encodings-override
(clear-accepted-encodings-override)
(clear-accepted-encodings-override {:as params, :keys []})
(clear-accepted-encodings-override connection {:as params, :keys []})
Clears accepted encodings set by setAcceptedEncodings
clear-browser-cache
(clear-browser-cache)
(clear-browser-cache {:as params, :keys []})
(clear-browser-cache connection {:as params, :keys []})
Clears browser cache.
clear-browser-cookies
(clear-browser-cookies)
(clear-browser-cookies {:as params, :keys []})
(clear-browser-cookies connection {:as params, :keys []})
Clears browser cookies.
continue-intercepted-request
(continue-intercepted-request)
(continue-intercepted-request {:as params, :keys [interception-id error-reason raw-response url method post-data headers auth-challenge-response]})
(continue-intercepted-request connection {:as params, :keys [interception-id error-reason raw-response url method post-data headers auth-challenge-response]})
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.
Parameters map keys:
Key | Description |
---|---|
:interception-id | null |
:error-reason | If set this causes the request to fail with the given reason. Passing Aborted for requests |
marked with isNavigationRequest
also cancels the navigation. Must not be set in response to an authChallenge. (optional) :raw-response | If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc… Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON) (optional) :url | If set the request url will be modified in a way that’s not observable by page. Must not be set in response to an authChallenge. (optional) :method | If set this allows the request method to be overridden. Must not be set in response to an authChallenge. (optional) :post-data | If set this allows postData to be set. Must not be set in response to an authChallenge. (optional) :headers | If set this allows the request headers to be changed. Must not be set in response to an authChallenge. (optional) :auth-challenge-response | Response to a requestIntercepted with an authChallenge. Must not be set otherwise. (optional)
delete-cookies
(delete-cookies)
(delete-cookies {:as params, :keys [name url domain path]})
(delete-cookies connection {:as params, :keys [name url domain path]})
Deletes browser cookies with matching name and url or domain/path pair.
Parameters map keys:
Key | Description |
---|---|
:name | Name of the cookies to remove. |
:url | If specified, deletes all the cookies with the given name where domain and path match |
provided URL. (optional) :domain | If specified, deletes only cookies with the exact domain. (optional) :path | If specified, deletes only cookies with the exact path. (optional)
disable
(disable)
(disable {:as params, :keys []})
(disable connection {:as params, :keys []})
Disables network tracking, prevents network events from being sent to the client.
emulate-network-conditions
(emulate-network-conditions)
(emulate-network-conditions {:as params, :keys [offline latency download-throughput upload-throughput connection-type]})
(emulate-network-conditions connection {:as params, :keys [offline latency download-throughput upload-throughput connection-type]})
Activates emulation of network conditions.
Parameters map keys:
Key | Description |
---|---|
:offline | True to emulate internet disconnection. |
:latency | Minimum latency from request sent to response headers received (ms). |
:download-throughput | Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. |
:upload-throughput | Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. |
:connection-type | Connection type if known. (optional) |
enable
(enable)
(enable {:as params, :keys [max-total-buffer-size max-resource-buffer-size max-post-data-size]})
(enable connection {:as params, :keys [max-total-buffer-size max-resource-buffer-size max-post-data-size]})
Enables network tracking, network events will now be delivered to the client.
Parameters map keys:
Key | Description |
---|---|
:max-total-buffer-size | Buffer size in bytes to use when preserving network payloads (XHRs, etc). (optional) |
:max-resource-buffer-size | Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). (optional) |
:max-post-data-size | Longest post body size (in bytes) that would be included in requestWillBeSent notification (optional) |
enable-reporting-api
(enable-reporting-api)
(enable-reporting-api {:as params, :keys [enable]})
(enable-reporting-api connection {:as params, :keys [enable]})
Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. Enabling triggers ‘reportingApiReportAdded’ for all existing reports.
Parameters map keys:
Key | Description |
---|---|
:enable | Whether to enable or disable events for the Reporting API |
get-all-cookies
(get-all-cookies)
(get-all-cookies {:as params, :keys []})
(get-all-cookies connection {:as params, :keys []})
Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies
field.
Return map keys:
Key | Description |
---|---|
:cookies | Array of cookie objects. |
get-certificate
(get-certificate)
(get-certificate {:as params, :keys [origin]})
(get-certificate connection {:as params, :keys [origin]})
Returns the DER-encoded certificate.
Parameters map keys:
Key | Description |
---|---|
:origin | Origin to get certificate for. |
Return map keys:
Key | Description |
---|---|
:table-names | null |
get-cookies
(get-cookies)
(get-cookies {:as params, :keys [urls]})
(get-cookies connection {:as params, :keys [urls]})
Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the cookies
field.
Parameters map keys:
Key | Description |
---|---|
:urls | 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. (optional)
Return map keys:
Key | Description |
---|---|
:cookies | Array of cookie objects. |
get-request-post-data
(get-request-post-data)
(get-request-post-data {:as params, :keys [request-id]})
(get-request-post-data connection {:as params, :keys [request-id]})
Returns post data sent with the request. Returns an error when no data was sent with the request.
Parameters map keys:
Key | Description |
---|---|
:request-id | Identifier of the network request to get content for. |
Return map keys:
Key | Description |
---|---|
:post-data | Request body string, omitting files from multipart requests |
get-response-body
(get-response-body)
(get-response-body {:as params, :keys [request-id]})
(get-response-body connection {:as params, :keys [request-id]})
Returns content served for the given request.
Parameters map keys:
Key | Description |
---|---|
:request-id | Identifier of the network request to get content for. |
Return map keys:
Key | Description |
---|---|
:body | Response body. |
:base64-encoded | True, if content was sent as base64. |
get-response-body-for-interception
(get-response-body-for-interception)
(get-response-body-for-interception {:as params, :keys [interception-id]})
(get-response-body-for-interception connection {:as params, :keys [interception-id]})
Returns content served for the given currently intercepted request.
Parameters map keys:
Key | Description |
---|---|
:interception-id | Identifier for the intercepted request to get body for. |
Return map keys:
Key | Description |
---|---|
:body | Response body. |
:base64-encoded | True, if content was sent as base64. |
get-security-isolation-status
(get-security-isolation-status)
(get-security-isolation-status {:as params, :keys [frame-id]})
(get-security-isolation-status connection {:as params, :keys [frame-id]})
Returns information about the COEP/COOP isolation status.
Parameters map keys:
Key | Description |
---|---|
:frame-id | If no frameId is provided, the status of the target is provided. (optional) |
Return map keys:
Key | Description |
---|---|
:status | null |
load-network-resource
(load-network-resource)
(load-network-resource {:as params, :keys [frame-id url options]})
(load-network-resource connection {:as params, :keys [frame-id url options]})
Fetches the resource and returns the content.
Parameters map keys:
Key | Description |
---|---|
:frame-id | Frame id to get the resource for. Mandatory for frame targets, and |
should be omitted for worker targets. (optional) :url | URL of the resource to get content for. :options | Options for the request.
Return map keys:
Key | Description |
---|---|
:resource | null |
replay-xhr
(replay-xhr)
(replay-xhr {:as params, :keys [request-id]})
(replay-xhr connection {:as params, :keys [request-id]})
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 map keys:
Key | Description |
---|---|
:request-id | Identifier of XHR to replay. |
search-in-response-body
(search-in-response-body)
(search-in-response-body {:as params, :keys [request-id query case-sensitive is-regex]})
(search-in-response-body connection {:as params, :keys [request-id query case-sensitive is-regex]})
Searches for given string in response content.
Parameters map keys:
Key | Description |
---|---|
:request-id | Identifier of the network response to search. |
:query | String to search for. |
:case-sensitive | If true, search is case sensitive. (optional) |
:is-regex | If true, treats string parameter as regex. (optional) |
Return map keys:
Key | Description |
---|---|
:result | List of search matches. |
set-accepted-encodings
(set-accepted-encodings)
(set-accepted-encodings {:as params, :keys [encodings]})
(set-accepted-encodings connection {:as params, :keys [encodings]})
Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
Parameters map keys:
Key | Description |
---|---|
:encodings | List of accepted content encodings. |
set-attach-debug-stack
(set-attach-debug-stack)
(set-attach-debug-stack {:as params, :keys [enabled]})
(set-attach-debug-stack connection {:as params, :keys [enabled]})
Specifies whether to attach a page script stack id in requests
Parameters map keys:
Key | Description |
---|---|
:enabled | Whether to attach a page script stack for debugging purpose. |
set-blocked-ur-ls
(set-blocked-ur-ls)
(set-blocked-ur-ls {:as params, :keys [urls]})
(set-blocked-ur-ls connection {:as params, :keys [urls]})
Blocks URLs from loading.
Parameters map keys:
Key | Description |
---|---|
:urls | URL patterns to block. Wildcards (‘*’) are allowed. |
set-bypass-service-worker
(set-bypass-service-worker)
(set-bypass-service-worker {:as params, :keys [bypass]})
(set-bypass-service-worker connection {:as params, :keys [bypass]})
Toggles ignoring of service worker for each request.
Parameters map keys:
Key | Description |
---|---|
:bypass | Bypass service worker and load from network. |
set-cache-disabled
(set-cache-disabled)
(set-cache-disabled {:as params, :keys [cache-disabled]})
(set-cache-disabled connection {:as params, :keys [cache-disabled]})
Toggles ignoring cache for each request. If true
, cache will not be used.
Parameters map keys:
Key | Description |
---|---|
:cache-disabled | Cache disabled state. |
set-cookie
(set-cookie)
(set-cookie {:as params, :keys [name value url domain path secure http-only same-site expires priority same-party source-scheme source-port partition-key]})
(set-cookie connection {:as params, :keys [name value url domain path secure http-only same-site expires priority same-party source-scheme source-port partition-key]})
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
Parameters map keys:
Key | Description |
---|---|
:name | Cookie name. |
:value | Cookie value. |
:url | The request-URI to associate with the setting of the cookie. This value can affect the |
default domain, path, source port, and source scheme values of the created cookie. (optional) :domain | Cookie domain. (optional) :path | Cookie path. (optional) :secure | True if cookie is secure. (optional) :http-only | True if cookie is http-only. (optional) :same-site | Cookie SameSite type. (optional) :expires | Cookie expiration date, session cookie if not set (optional) :priority | Cookie Priority type. (optional) :same-party | True if cookie is SameParty. (optional) :source-scheme | Cookie source scheme type. (optional) :source-port | Cookie source port. Valid values are {-1, 1, 65535}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future. (optional) :partition-key | Cookie partition key. The site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. If not set, the cookie will be set as not partitioned. (optional)
Return map keys:
Key | Description |
---|---|
:success | Always set to true. If an error occurs, the response indicates protocol error. |
set-cookies
(set-cookies)
(set-cookies {:as params, :keys [cookies]})
(set-cookies connection {:as params, :keys [cookies]})
Sets given cookies.
Parameters map keys:
Key | Description |
---|---|
:cookies | Cookies to be set. |
set-extra-http-headers
(set-extra-http-headers)
(set-extra-http-headers {:as params, :keys [headers]})
(set-extra-http-headers connection {:as params, :keys [headers]})
Specifies whether to always send extra HTTP headers with the requests from this page.
Parameters map keys:
Key | Description |
---|---|
:headers | Map with extra HTTP headers. |
set-request-interception
(set-request-interception)
(set-request-interception {:as params, :keys [patterns]})
(set-request-interception connection {:as params, :keys [patterns]})
Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
Parameters map keys:
Key | Description |
---|---|
:patterns | Requests matching any of these patterns will be forwarded and wait for the corresponding |
continueInterceptedRequest call.
set-user-agent-override
(set-user-agent-override)
(set-user-agent-override {:as params, :keys [user-agent accept-language platform user-agent-metadata]})
(set-user-agent-override connection {:as params, :keys [user-agent accept-language platform user-agent-metadata]})
Allows overriding user agent with the given string.
Parameters map keys:
Key | Description |
---|---|
:user-agent | User agent to use. |
:accept-language | Browser langugage to emulate. (optional) |
:platform | The platform navigator.platform should return. (optional) |
:user-agent-metadata | To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData (optional) |
take-response-body-for-interception-as-stream
(take-response-body-for-interception-as-stream)
(take-response-body-for-interception-as-stream {:as params, :keys [interception-id]})
(take-response-body-for-interception-as-stream connection {:as params, :keys [interception-id]})
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.
Parameters map keys:
Key | Description |
---|---|
:interception-id | null |
Return map keys:
Key | Description |
---|---|
:stream | null |