Install
openclaw skills install browser-agent-bridge-cliUse this skill when you need to control or make actions on the user's chrome tab.
openclaw skills install browser-agent-bridge-cliUse this skill when you need to control a real Chrome tab. Typical situations:
Project:
This workflow has three connected parts:
CLI commands used:
browser-bridge-server to run the serverbrowser-bridge to run operator actionsBefore starting the server, generate strong tokens. Do not use weak defaults.
Example token generation:
python3 - <<'PY'
import secrets
print("BRIDGE_SHARED_TOKEN=" + secrets.token_urlsafe(32))
print("BRIDGE_OPERATOR_TOKEN=" + secrets.token_urlsafe(32))
PY
Use generated values when starting the server. Share only the client token (BRIDGE_SHARED_TOKEN) with the user for extension setup. Keep operator token for agent CLI usage.
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install browser-agent-bridge
Upgrade later:
pipx upgrade browser-agent-bridge
Use static auth for straightforward local setup:
export BRIDGE_AUTH_MODE=static
export BRIDGE_SHARED_TOKEN='change-me-strong-token'
export BRIDGE_OPERATOR_TOKEN='Str0ng!Operator#42'
browser-bridge-server >/tmp/browser-bridge-server.log 2>&1 &
echo $! >/tmp/browser-bridge-server.pid
Start browser-bridge-server in the background. Do not leave it attached to the current shell, because the agent needs that shell for follow-up CLI commands, status checks, and diagnostics. If startup needs verification, inspect the log file or process state after backgrounding it.
Default endpoints:
ws://127.0.0.1:8765/ws/clientws://127.0.0.1:8765/ws/operatorchrome://extensions.Developer mode.Load unpacked.extension/ folder).Bridge Server WS URL: ws://127.0.0.1:8765/ws/clientInstance ID: local-instanceClient ID: chrome-mainAuth Token / JWT: value of BRIDGE_SHARED_TOKEN generated by the agentSave, then Connect.All examples use:
instance_id=local-instanceclient_id=chrome-mainStr0ng!Operator#42ws://127.0.0.1:8765/ws/operatorYou can pass the operator token either with --token or by exporting BRIDGE_OPERATOR_TOKEN. The examples below use --token explicitly for clarity.
List connected browser clients:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' list-clients
Check whether the specific client is connected:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
connect-status --instance-id local-instance --client-id chrome-main
Check whether tab command channel is ready:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
ping-tab --instance-id local-instance --client-id chrome-main
Observe interactive nodes on current page:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
observe --instance-id local-instance --client-id chrome-main --max-nodes 150
Get page HTML snapshot:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
send-command --instance-id local-instance --client-id chrome-main \
--type get_html --payload '{"max_chars":40000}'
Navigate with adaptive load wait:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
send-command --instance-id local-instance --client-id chrome-main \
--type navigate --payload '{"url":"https://example.com","wait_for_load":true,"wait_for_load_ms":7000}'
Click without load wait:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
send-command --instance-id local-instance --client-id chrome-main \
--type click --payload '{"selector":"a[href]","wait_for_load":false}'
Type into an element:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
send-command --instance-id local-instance --client-id chrome-main \
--type type --payload '{"selector":"input[name=q]","text":"browser bridge"}'
Press a special key:
browser-bridge --server-ws-url ws://127.0.0.1:8765/ws/operator --token 'Str0ng!Operator#42' \
send-command --instance-id local-instance --client-id chrome-main \
--type press_key --payload '{"key":"Enter","selector":"input[name=q]"}'
press_key supports:
Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Spacereturn, esc, del, up, down, left, right, spacebaralt_key, ctrl_key, meta_key, shift_keyselector, ref, click_ref, or locatordocument.activeElement when no selector/ref is providedinstance_id, client_id, and token.list-clients.connect-status.ping-tab.observe before action commands.send-command actions (navigate, click, type, press_key, scroll, get_html).observe to confirm page state after actions.Target client not connected
instance_id and client_id exactly match CLI flags.Operator auth failed or auth errors
--token matches BRIDGE_OPERATOR_TOKEN.Command timed out
--timeout-s.chrome://*).Receiving end does not exist
Slow responses on action commands
wait_for_load=false for immediate response.wait_for_load_ms.wss://) and strong secrets.list-clients returns expected client.connect-status is connected.ping-tab reports ready.observe returns page data.send-command actions return valid results.