diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index a915f148e..da40a723a 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "6d427f8c2ac068308435dab61109d05abbeb0f01", - "syncedAt": "2026-04-19T06:49:17.453Z" + "sha": "4cfc8cd5beb218b2e47cd823a9d4ddc50045bc57", + "syncedAt": "2026-04-19T09:44:23.564Z" } diff --git a/docs/tools/browser.md b/docs/tools/browser.md index c604e96b5..f64991a59 100644 --- a/docs/tools/browser.md +++ b/docs/tools/browser.md @@ -316,15 +316,29 @@ Notes: ## Direct WebSocket CDP providers Some hosted browser services expose a **direct WebSocket** endpoint rather than -the standard HTTP-based CDP discovery (`/json/version`). OpenClaw supports both: +the standard HTTP-based CDP discovery (`/json/version`). OpenClaw accepts three +CDP URL shapes and picks the right connection strategy automatically: -- **HTTP(S) endpoints** — OpenClaw calls `/json/version` to discover the - WebSocket debugger URL, then connects. -- **WebSocket endpoints** (`ws://` / `wss://`) — OpenClaw connects directly, - skipping `/json/version`. Use this for services like - [Browserless](https://browserless.io), - [Browserbase](https://www.browserbase.com), or any provider that hands you a - WebSocket URL. +- **HTTP(S) discovery** — `http://host[:port]` or `https://host[:port]`. + OpenClaw calls `/json/version` to discover the WebSocket debugger URL, then + connects. No WebSocket fallback. +- **Direct WebSocket endpoints** — `ws://host[:port]/devtools//` or + `wss://...` with a `/devtools/browser|page|worker|shared_worker|service_worker/` + path. OpenClaw connects directly via a WebSocket handshake and skips + `/json/version` entirely. +- **Bare WebSocket roots** — `ws://host[:port]` or `wss://host[:port]` with no + `/devtools/...` path (e.g. [Browserless](https://browserless.io), + [Browserbase](https://www.browserbase.com)). OpenClaw tries HTTP + `/json/version` discovery first (normalising the scheme to `http`/`https`); + if discovery returns a `webSocketDebuggerUrl` it is used, otherwise OpenClaw + falls back to a direct WebSocket handshake at the bare root. This covers + both Chrome-style remote debug ports and WebSocket-only providers. + +Plain `ws://host:port` / `wss://host:port` without a `/devtools/...` path +pointed at a local Chrome instance is supported via the discovery-first +fallback — Chrome only accepts WebSocket upgrades on the specific per-browser +or per-target path returned by `/json/version`, so a bare-root handshake alone +would fail. ### Browserbase