network_rules
Manage network requests in Chrome by blocking, redirecting, modifying headers, stubbing responses, and recording/replaying API traffic with forced errors or delays.
Instructions
Network interception, browser-wide, survives reloads until cleared: block, redirect, set/remove headers, stub a synthetic body, or record real API responses and replay them with forced errors/latency (local helper; from HTTPS pages the stub host must be trusted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Response body (action=stub) | |
| name | No | Fixture name for record/replay | |
| action | Yes | record saves the page's API responses (url_filter) as a fixture, replay serves them with overrides; list/clear | |
| header | No | Header name for action=modify_header, e.g. "User-Agent" | |
| status | No | action=stub | |
| overrides | No | replay: force a status, body or delay on matching URLs — error states a real backend will not produce | |
| url_filter | No | declarativeNetRequest urlFilter, e.g. "||example.com/api/*" | |
| content_type | No | action=stub | application/json |
| header_value | No | Omit to remove header | |
| redirect_url | No | Destination for action=redirect | |
| header_target | No | response = strip content-security-policy / x-frame-options, inject CORS | request |
| resource_types | No | Limit the rule to these request types; omitted = all of them |