Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
For setup, configuration, and troubleshooting, see Browser. This page is the reference for the local control HTTP API, the
openclaw browserFor local integrations only, the Gateway exposes a small loopback HTTP API:
GET /POST /startPOST /stopGET /tabsPOST /tabs/openPOST /tabs/focusDELETE /tabs/:targetIdGET /snapshotPOST /screenshotPOST /navigatePOST /actPOST /hooks/file-chooserPOST /hooks/dialogPOST /downloadPOST /wait/downloadPOST /permissions/grantGET /consolePOST /pdfGET /errorsGET /requestsPOST /trace/startPOST /trace/stopPOST /highlightPOST /response/bodyGET /cookiesPOST /cookies/setPOST /cookies/clearGET /storage/:kindPOST /storage/:kind/setPOST /storage/:kind/clearPOST /set/offlinePOST /set/headersPOST /set/credentialsPOST /set/geolocationPOST /set/mediaPOST /set/timezonePOST /set/localePOST /set/deviceAll endpoints accept
?profile=<name>POST /start?headless=trueIf shared-secret gateway auth is configured, browser HTTP routes require auth too:
Authorization: Bearer <gateway token>x-openclaw-password: <gateway password>Notes:
gateway.auth.modenonetrusted-proxy/actPOST /actjson{ "error": "<message>", "code": "ACT_*" }
Current
codeACT_KIND_REQUIREDkindACT_INVALID_REQUESTACT_SELECTOR_UNSUPPORTEDselectorACT_EVALUATE_DISABLEDevaluatewait --fnACT_TARGET_ID_MISMATCHtargetIdACT_EXISTING_SESSION_UNSUPPORTEDOther runtime failures may still return
{ "error": "<message>" }codeSome features (navigate/act/AI snapshot/role snapshot, element screenshots, PDF) require Playwright. If Playwright isn’t installed, those endpoints return a clear 501 error.
What still works without Playwright:
--interactive--compact--depth--efficientopenclawexisting-sessionexisting-session--refWhat still needs Playwright:
navigateact--elementElement screenshots also reject
--full-pagefullPage is not supported for element screenshotsIf you see
Playwright is not available in this gateway buildplaywright-coreopenclaw doctor --fixIf your Gateway runs in Docker, avoid
npx playwrightbashdocker compose run --rm openclaw-cli \ node /app/node_modules/playwright-core/cli.js install chromium
To persist browser downloads, set
PLAYWRIGHT_BROWSERS_PATH/home/node/.cache/ms-playwright/home/nodeOPENCLAW_HOME_VOLUMEA small loopback control server accepts HTTP requests and connects to Chromium-based browsers via CDP. Advanced actions (click/type/snapshot/PDF) go through Playwright on top of CDP; when Playwright is missing, only non-Playwright operations are available. The agent sees one stable interface while local/remote browsers and profiles swap freely underneath.
All commands accept
--browser-profile <name>--jsonNotes:
uploaddialogclicktyperefsnapshot12e12ax12click-coords/tmp/openclaw{,/downloads,/uploads}${os.tmpdir()}/openclaw/...upload--input-ref--elementStable tab ids and labels survive Chromium raw-target replacement when OpenClaw can prove the replacement tab, such as same URL or a single old tab becoming a single new tab after form submission. Raw target ids are still volatile; prefer
suggestedTargetIdtabsSnapshot flags at a glance:
--format aiaria-ref="<n>"--format ariaaxN--efficient--mode efficientbrowser.snapshotDefaults.mode: "efficient"--interactive--compact--depth--selectorref=e12--frame "<iframe>"--labelsMEDIA:<path>--urlsOpenClaw supports two “snapshot” styles:
AI snapshot (numeric refs):
openclaw browser snapshot--format aiopenclaw browser click 12openclaw browser type 23 "hello"aria-refRole snapshot (role refs like e12
openclaw browser snapshot --interactive--compact--depth--selector--frame[ref=e12][nth=1]openclaw browser click e12openclaw browser highlight e12getByRole(...)nth()--labelse12--urlsARIA snapshot (ARIA refs like ax12
openclaw browser snapshot --format ariaopenclaw browser click ax12If Playwright is unavailable, ARIA snapshots can still be useful for inspection, but refs may not be actionable. Re-snapshot with
--format ai--interactiveDocker proof for the raw-CDP fallback path:
pnpm test:docker:browser-cdp-snapshotbrowser doctor --deepRef behavior:
snapshot/acttargetId--frameaxNaria-refYou can wait on more than just time/text:
openclaw browser wait --url "**/dash"openclaw browser wait --load networkidleopenclaw browser wait --fn "window.ready===true"openclaw browser wait "#main"These can be combined:
bashopenclaw browser wait "#main" \ --url "**/dash" \ --load networkidle \ --fn "window.ready===true" \ --timeout-ms 15000
When an action fails (e.g. “not visible”, “strict mode violation”, “covered”):
openclaw browser snapshot --interactiveclick <ref>type <ref>openclaw browser highlight <ref>openclaw browser errors --clearopenclaw browser requests --filter api --clearopenclaw browser trace startopenclaw browser trace stopTRACE:<path>--jsonExamples:
bashopenclaw browser status --json openclaw browser snapshot --interactive --json openclaw browser requests --filter api --json openclaw browser cookies --json
Role snapshots in JSON include
refsstatsThese are useful for “make the site behave like X” workflows:
cookiescookies setcookies clearstorage local|session get|set|clearset offline on|offset headers --headers-json '{"X-Debug":"1"}'set headers --json '{"X-Debug":"1"}'set credentials user pass--clearset geo <lat> <lon> --origin "https://example.com"--clearset media dark|light|no-preference|noneset timezone ...set locale ...set device "iPhone 14"set viewport 1280 720browser act kind=evaluateopenclaw browser evaluatewait --fnbrowser.evaluateEnabled=falseStrict-mode example (block private/internal destinations by default):
json5{ browser: { ssrfPolicy: { dangerouslyAllowPrivateNetwork: false, hostnameAllowlist: ["*.example.com", "example.com"], allowedHostnames: ["localhost"], // optional exact allow }, }, }
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine