A page makes a request
Runs the macro when a page finishes a network request, such as an API call, in a Chrome-family browser. Requests are observed, never blocked.
A page makes a request
Details #
Needs the browser extension (Settings ▸ Browsers). The Chrome family only. Switchboard watches what the page asked for and how it ended; it never changes or blocks a request.
Filter by method, status, type (xhr, fetch, script, image, document) and requestUrl (a URL pattern). match is about the page that made the request. The run starts with requestUrl, method, status, type and ms.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
match | record | browser title url | Which pages. url is a pattern (https://*.github.com/*/pull/*), a plain start (github.com/apple) or /regex/; title is text (any case) or /regex/; browser is safari, chrome or any. | |
method | text | GET, POST and so on. | ||
requestUrl | text | Only requests to addresses matching this pattern. | ||
status | number | The HTTP status. | ||
type | one of | xhr fetch script image document | xhr, fetch, script, image or document. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
- A page makes a request to api.example.com/* that ends with 500
- Show a notification “API error”
Gotchas #
Response bodies are not available.