Browse the docs

POST /browser/call

Asks a connected browser extension to do something and returns its answer (ping, javaScript, spike.probe).

Details #

Body: {"name": "javaScript", "data": {"script": "document.title"}, "browser": "safari|chrome", "tab": 12, "timeout": 20}. Only name is required; timeout is in seconds (1 to 600). The call goes to the most recently connected extension of that browser and waits for timeout seconds (default 20). The answer is whatever the extension returned. 503 means no such extension is connected (or the browser can't do it); 502 means the extension refused or the page threw.

Parameters #

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

Ask a connected browser extension to do something and return its answer. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

See also #