Skip to main content
All of these are devtools_network actions and need a running devtools_session on the tab. Pass the intended browser’s tabId on each call. They are undone when the last agent stops the inspection session. Firefox and Zen developer sessions support mocks, blocking, cache control and HAR export through BiDi, but network and CPU throttling are unavailable. Response-body capture depends on the browser build. Firefox extension mode does not provide network capture or interception. See Firefox and Zen coverage.

Mock a response

pattern is a URL glob. response takes status, headers, contentType, and either body (string) or json. rules lists active mocks, unmock removes one by pattern. Mocks use browser network interception, so they also cover requests made before the page’s JavaScript runs.

Block requests

Blocked requests fail in the page like a network error. unblock lifts them. For a policy that persists across tabs and sessions, use browser_policy instead; see Domain policies.

Throttle

Presets: none, offline, slow3g, fast3g, 4g, or custom latencyMs, downloadKbps, uploadKbps. CPU throttling lives in devtools_emulation {action: "cpu", rate}.

Cache

{ "action": "cache", "disabled": true } is the “Disable cache” checkbox.

Replay

Re-issues a captured request from the page with optional changes to method, URL, headers or body, and returns the response. Handy for probing an API without touching the UI. On Firefox and Zen, supply the body explicitly when the original request body was not captured.

Export

{ "action": "har" } writes a HAR file of everything captured to the artifacts directory. It opens in Chrome’s Network panel, Charles, Proxyman and friends.