network_add_mock
Intercept and mock network requests in a browser tab by defining URL patterns, HTTP methods, and custom response codes, headers, and bodies.
Instructions
Add a network mock rule that intercepts matching requests.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | HTTP method to match (optional, matches all if omitted) | |
| targetId | Yes | Target ID of the tab | |
| urlPattern | Yes | URL pattern to match (supports * and ** glob wildcards) | |
| responseBody | No | Response body string | |
| responseCode | Yes | HTTP response code to return | |
| responseHeaders | No | Response headers as key-value pairs |