browser_intercept_request
Intercept, block, or mock network requests to control API responses, block ads or tracking, and test error handling by simulating network failures.
Instructions
Intercept, block, or mock network requests matching a URL pattern.
Use this to:
Block requests (e.g., block ads, tracking scripts)
Mock API responses (return custom JSON)
Test error handling (simulate network failures)
Args: url_pattern: URL pattern to match (e.g., "/api/*", "/analytics/*") action: "block" to abort matching requests, "mock" to return custom response response_body: JSON string for mock responses (only used when action="mock") session_id: Browser session ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | block | |
| session_id | No | default | |
| url_pattern | Yes | ||
| response_body | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |