Your browser, on tap. HTTP REST API + CLI over chrome-tap.
chrome-tap (WS :9867) ←→ ontap (HTTP :9868) ←→ curl / scripts / anything
ontap tabs # list browser tabs
ontap eval 123 "document.title" # run JS in a tab
ontap navigate 123 "https://example.com"
ontap screenshot 123 page.png # save screenshot
ontap html 123 # get page HTML
ontap cdp 123 DOM.getDocument # raw CDP passthroughontap serve # starts on http://127.0.0.1:9868# list tabs
curl localhost:9868/tabs
# run JS
curl -X POST localhost:9868/tabs/123/evaluate \
-d '{"expression": "document.title"}'
# navigate
curl -X POST localhost:9868/tabs/123/navigate \
-d '{"url": "https://example.com"}'
# screenshot (returns PNG)
curl localhost:9868/tabs/123/screenshot > page.png
# page HTML
curl localhost:9868/tabs/123/html
# enable console + read messages
curl -X POST localhost:9868/tabs/123/console/enable
curl localhost:9868/tabs/123/console
curl "localhost:9868/tabs/123/console?clear=true"
# enable network + read requests
curl -X POST localhost:9868/tabs/123/network/enable
curl localhost:9868/tabs/123/network
# raw CDP passthrough
curl -X POST localhost:9868/cdp \
-d '{"tabId": 123, "method": "DOM.getDocument", "params": {}}'Tabs auto-attach on first use. Console/network events are buffered with ring buffer limits (1000/2000 respectively).
const { TapClient } = require('ontap');
const client = new TapClient();
const tabs = await client.tabs();
const result = await client.evaluate(tabs[0].tabId, 'document.title');
client.close();| Env var | Default | Description |
|---|---|---|
ONTAP_PORT |
9868 |
HTTP server port |
CHROME_TAP_PORT |
9867 |
chrome-tap WS port |
chrome-tap running (extension + native host).
MIT