Browse the docs

POST /browser/emit

Fakes a page event, as if a page had called switchboard.emit, so the macros listening for it run.

Details #

Body: {"name": "save-page", "data": {…}, "browser": "safari|chrome", "tab": 12}. Only name is required. The event goes to the same place a real page event does. Answers {"emitted": name}; 404 when the bridge isn't running in this process.

Parameters #

curl --unix-socket "$SWITCHBOARD_HOME/engine.sock" -X POST http://localhost/browser/emit

Fake a page event, as if a page had called switchboard.emit. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

See also #