safari_mock_route
Intercept network requests matching a URL pattern and return mock responses for testing API error states, offline behavior, or replacing API responses in Safari browser automation.
Instructions
Intercept network requests matching a URL pattern and return a mock response. Works with both fetch and XHR. Useful for testing API error states, offline behavior, or replacing API responses.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urlPattern | Yes | URL substring or regex pattern to match (e.g. '/api/users' or 'example\.com') | |
| response | Yes | Mock response to return |