Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
matchrecordbrowser title urlWhich 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.
methodtextGET, POST and so on.
requestUrltextOnly requests to addresses matching this pattern.
statusnumberThe HTTP status.
typeone ofxhr fetch script image documentxhr, 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 #

Notice a failing API call
When
  1. A page makes a request to api.example.com/* that ends with 500
Do
  1. Show a notification “API error”
Open in Switchboard to try it

Gotchas #

  • Response bodies are not available.