@@ -107,7 +107,7 @@ openclaw config set browser.defaultProfile chrome
107107Fresh automatic pairings use ** All tabs** . Existing valid pairings are never
108108overwritten, and older pairings keep their stored access mode.
109109
110- For local setup, native bootstrap connects the extension through the local
110+ For fresh local setup, native bootstrap connects the extension through the local
111111Gateway's exact ` /browser/extension ` route. That first authenticated connection
112112wakes the lazy browser-control service and starts the profile's loopback relay;
113113OpenClaw and local clients such as mcporter then use that profile relay port.
@@ -119,6 +119,43 @@ the browser-node host while the node uses its configured remote Gateway. An
119119explicit ` --gateway-url ` pairing connects directly to that remote Gateway and
120120remains a manual-only flow.
121121
122+ ### Standalone direct-loopback relay
123+
124+ A pairing on ` ws://127.0.0.1:<port>/extension ` can run without a local Gateway
125+ or browser node. On macOS and Linux, the bundled extension can ask the installed
126+ native host to start a standalone relay when reconnecting to that endpoint.
127+ Automatic local setup must be enabled. Requests are limited to once per minute;
128+ the extension still authenticates the relay with connection-bound v2 proofs.
129+ This requires both the updated native host and an extension build containing
130+ relay wake-up support. Do not assume the Store v2.2.0 build includes that code;
131+ the bundled unpacked development copy is the source-build validation path.
132+
133+ Automatic wake-up requires the exact ` 127.0.0.1 ` host that the daemon serves.
134+ Other loopback aliases, including ` localhost ` and IPv6, do not trigger wake-up;
135+ use the canonical IPv4 endpoint when pairing for standalone operation.
136+
137+ Wake-up uses the port in the extension's existing canonical pairing. It does
138+ not switch to the first configured profile. The native host resolves current
139+ ` browser.profiles ` and permits only an extension-driver relay port, including
140+ automatically allocated ports and explicit ` cdpPort ` pins. A removed profile
141+ or stale port fails closed; correct the pairing to match the current profile.
142+ Gateway ` /browser/extension ` routes and remote pairings never trigger local
143+ daemon wake-up. Browser-node pairings that use a direct loopback relay can use
144+ it even when their Gateway hint points to a remote host.
145+
146+ An existing listener keeps ownership of its port. Otherwise, the native host
147+ spawns ` dist/extensions/browser/relay-daemon-entry.js ` as a detached process.
148+ The daemon uses the same per-host relay key and stays alive while an extension
149+ or CDP client is connected. After both disconnect, it exits following ten
150+ minutes of inactivity, checked every 30 seconds. Closing Chrome alone does not
151+ stop it while a CDP client remains connected. A later reconnect can wake it again.
152+
153+ The standalone daemon defaults to ** v2-only authentication** , independently of
154+ the Gateway relay's legacy default. Only an explicit
155+ ` browser.extensionRelay.allowLegacyAuth=true ` enables legacy authentication;
156+ an unset value, ` false ` , or a config-read failure never enables it. Prefer v2
157+ clients so the persistent key is not disclosed to a process occupying the port.
158+
122159### Choose tab access
123160
124161- ** All tabs** exposes every eligible ordinary tab in that Chrome profile,
@@ -165,7 +202,7 @@ Settings shows redacted relay/native bootstrap status and the **Use automatic
165202local setup** switch.
166203
167204- Turning automatic setup off preserves a valid existing pairing but prevents
168- new native bootstrap attempts.
205+ new native bootstrap and standalone relay wake-up attempts.
169206- ** Disconnect and disable automatic setup** revokes the pairing immediately,
170207 detaches debugger sessions, and persists the opt-out.
171208- ** Use local OpenClaw** clears the opt-out and retries the native host.
@@ -233,8 +270,10 @@ Manual pairing remains useful on Windows and for recovery. Treat the complete
233270pairing string as a password.
234271
235272Without ` --gateway-url ` , this command retains the host-local ` /extension ` relay
236- for standalone manual pairing. It does not wake Browser control; the selected
237- profile relay must already be running before the extension connects.
273+ for standalone manual pairing. It does not wake Browser control. With native
274+ wake-up support installed and automatic local setup enabled, the extension can
275+ start that relay on reconnect without a local Gateway. Otherwise, the relay
276+ must already be running, for example through Browser control or a browser node.
238277
239278For a laptop that has Chrome but does not run OpenClaw or a browser node, pair
240279directly to a remote Gateway:
@@ -330,20 +369,28 @@ The extension requests only:
330369- ` tabs ` and ` tabGroups ` : discover tabs and enforce access mode;
331370- ` storage ` : persist pairing, access mode, session pauses, and bootstrap opt-out;
332371- ` alarms ` : wake the MV3 worker for relay/bootstrap retries;
333- - ` nativeMessaging ` : request one local bootstrap pairing.
372+ - ` nativeMessaging ` : request a local bootstrap pairing or wake its configured relay .
334373
335374It does not request ` activeTab ` , ` contextMenus ` , ` scripting ` , or ` sidePanel ` .
336375
337376## Native bootstrap security
338377
339- The native host is ` ai.openclaw.browser_bootstrap ` . Each
340- ` chrome.runtime.sendNativeMessage ` call starts one process, reads one request,
341- writes one response, and exits.
378+ The native host is ` ai.openclaw.browser_bootstrap ` . The extension opens a
379+ ` chrome.runtime.connectNative ` port for one request, validates the response,
380+ then disconnects. The host writes one response and exits; a spawned standalone
381+ relay outlives this short-lived native connection.
342382
343383The request uses a versioned, length-prefixed JSON frame with a fresh 16-byte
344384nonce. The host caps input at 4 KiB, requires fatal UTF-8 decoding and exact
345385fields, verifies the caller origin against the exact installed manifest, and
346- returns only a locally generated pairing or a bounded non-secret failure code.
386+ returns only a locally generated pairing, a relay status, or a bounded
387+ non-secret failure code. The bootstrap request remains exactly
388+ ` {v:1, op:"bootstrap", nonce} ` . Relay wake-up uses
389+ ` {v:1, op:"ensure_relay", nonce, relayPort} ` with a required integer port from
390+ 1 through 65535. Missing, duplicate, malformed, or extra fields are rejected.
391+ After manifest and caller validation, the host checks the requested port
392+ against current extension profiles before probing or spawning. No request can
393+ supply a host, executable path, or credential to the launcher.
347394The response is below Chrome's 1 MiB native-message limit. Pairing keys never
348395appear in launcher arguments, manifests, status JSON, or diagnostics.
349396
@@ -370,7 +417,10 @@ manifest has no `key`; only these development IDs depend on approved
370417OpenClaw-owned realpaths.
371418
372419The relay itself uses connection-bound HMAC proofs. The persistent per-host key
373- is not sent in a URL, header, WebSocket subprotocol, or application frame.
420+ is not sent in a URL, header, WebSocket subprotocol, or application frame during
421+ v2 authentication. On POSIX hosts, each key read rejects foreign-owned and
422+ non-regular files and tightens an owned group/other-accessible file to ` 0600 ` ;
423+ if tightening fails, the key is refused. Windows uses its existing ACL policy.
374424
375425## Troubleshooting
376426
@@ -399,10 +449,12 @@ openclaw doctor
399449 OpenClaw** .
400450- ** Manual setup required:** use Settings for the advanced pairing flow. This
401451 is expected on Windows and direct extension-only remote Gateway setups.
402- - ** Relay unavailable:** confirm ` openclaw gateway run ` or the managed Gateway
403- service is running for local setup, or confirm the browser node is running
404- for browser-node setup. Then run browser doctor. No separate browser prewarm
405- should be necessary.
452+ - ** Relay unavailable:** for ` /browser/extension ` pairings, confirm the target
453+ Gateway is running. For direct loopback ` /extension ` pairings, check native
454+ host registration, wake-up support in the extension build, automatic setup,
455+ and that the paired port still belongs to an extension profile. Allow for the
456+ one-minute wake-up throttle, then run browser doctor. No local Gateway is
457+ required for the standalone path.
406458
407459See [ Browser] ( /tools/browser ) for the full profile model and the managed
408460` openclaw ` and Chrome MCP ` user ` profiles.
0 commit comments