2026-01-15 04:50:11 +00:00
---
2026-01-30 03:15:10 +01:00
summary: "Chrome extension: let OpenClaw drive your existing Chrome tab"
2026-01-15 04:50:11 +00:00
read_when:
- You want the agent to drive an existing Chrome tab (toolbar button)
- You need remote Gateway + local browser automation via Tailscale
- You want to understand the security implications of browser takeover
2026-01-31 16:04:03 -05:00
title: "Chrome Extension"
2026-01-15 04:50:11 +00:00
---
# Chrome extension (browser relay)
2026-01-30 03:15:10 +01:00
The OpenClaw Chrome extension lets the agent control your **existing Chrome tabs** (your normal Chrome window) instead of launching a separate openclaw-managed Chrome profile.
2026-01-15 04:50:11 +00:00
Attach/detach happens via a **single Chrome toolbar button** .
## What it is (concept)
There are three parts:
2026-01-31 21:13:13 +09:00
2026-01-27 03:23:42 +00:00
- **Browser control service** (Gateway or node): the API the agent/tool calls (via the Gateway)
2026-01-15 04:50:11 +00:00
- **Local relay server** (loopback CDP): bridges between the control server and the extension (`http://127.0.0.1:18792` by default)
- **Chrome MV3 extension**: attaches to the active tab using `chrome.debugger` and pipes CDP messages to the relay
2026-01-30 03:15:10 +01:00
OpenClaw then controls the attached tab through the normal `browser` tool surface (selecting the right profile).
2026-01-15 04:50:11 +00:00
## Install / load (unpacked)
2026-01-31 21:13:13 +09:00
1. Install the extension to a stable local path:
2026-01-15 04:50:11 +00:00
```bash
2026-01-30 03:15:10 +01:00
openclaw browser extension install
2026-01-15 04:50:11 +00:00
```
2026-02-06 10:00:08 -05:00
2. Print the installed extension directory path:
2026-01-15 04:50:11 +00:00
```bash
2026-01-30 03:15:10 +01:00
openclaw browser extension path
2026-01-15 04:50:11 +00:00
```
2026-02-06 10:00:08 -05:00
3. Chrome → `chrome://extensions`
2026-01-31 21:13:13 +09:00
2026-01-15 04:50:11 +00:00
- Enable “Developer mode”
- “Load unpacked” → select the directory printed above
2026-02-06 10:00:08 -05:00
4. Pin the extension.
2026-01-15 04:50:11 +00:00
## Updates (no build step)
2026-01-30 03:15:10 +01:00
The extension ships inside the OpenClaw release (npm package) as static files. There is no separate “build” step.
2026-01-15 04:50:11 +00:00
2026-01-30 03:15:10 +01:00
After upgrading OpenClaw:
2026-01-31 21:13:13 +09:00
2026-01-30 03:15:10 +01:00
- Re-run `openclaw browser extension install` to refresh the installed files under your OpenClaw state directory.
2026-01-15 04:50:11 +00:00
- Chrome → `chrome://extensions` → click “Reload” on the extension.
2026-02-19 08:39:34 +01:00
## Use it (set gateway token once)
2026-01-15 08:26:23 +00:00
2026-01-30 03:15:10 +01:00
OpenClaw ships with a built-in browser profile named `chrome` that targets the extension relay on the default port.
2026-01-15 08:26:23 +00:00
2026-02-19 08:39:34 +01:00
Before first attach, open extension Options and set:
- `Port` (default `18792` )
- `Gateway token` (must match `gateway.auth.token` / `OPENCLAW_GATEWAY_TOKEN` )
2026-01-15 08:26:23 +00:00
Use it:
2026-01-31 21:13:13 +09:00
2026-01-30 03:15:10 +01:00
- CLI: `openclaw browser --browser-profile chrome tabs`
2026-01-15 08:26:23 +00:00
- Agent tool: `browser` with `profile="chrome"`
If you want a different name or a different relay port, create your own profile:
2026-01-15 04:50:11 +00:00
```bash
2026-01-30 03:15:10 +01:00
openclaw browser create-profile \
2026-01-15 08:26:23 +00:00
--name my-chrome \
2026-01-15 04:50:11 +00:00
--driver extension \
--cdp-url http://127.0.0.1:18792 \
--color "#00AA00 "
```
2026-02-20 14:09:37 +00:00
### Custom Gateway ports
If you're using a custom gateway port, the extension relay port is automatically derived:
**Extension Relay Port = Gateway Port + 3**
Example: if `gateway.port: 19001` , then:
- Extension relay port: `19004` (gateway + 3)
Configure the extension to use the derived relay port in the extension Options page.
2026-01-15 04:50:11 +00:00
## Attach / detach (toolbar button)
2026-01-30 03:15:10 +01:00
- Open the tab you want OpenClaw to control.
2026-01-15 04:50:11 +00:00
- Click the extension icon.
- Badge shows `ON` when attached.
- Click again to detach.
2026-01-15 05:20:56 +00:00
## Which tab does it control?
- It does **not** automatically control “whatever tab you’ re looking at”.
- It controls **only the tab(s) you explicitly attached** by clicking the toolbar button.
- To switch: open the other tab and click the extension icon there.
## Badge + common errors
2026-01-30 03:15:10 +01:00
- `ON` : attached; OpenClaw can drive that tab.
2026-01-15 05:20:56 +00:00
- `…` : connecting to the local relay.
2026-02-19 08:39:34 +01:00
- `!` : relay not reachable/authenticated (most common: relay server not running, or gateway token missing/wrong).
2026-01-15 05:20:56 +00:00
If you see `!` :
2026-01-31 21:13:13 +09:00
2026-01-27 03:23:42 +00:00
- Make sure the Gateway is running locally (default setup), or run a node host on this machine if the Gateway runs elsewhere.
2026-02-19 08:39:34 +01:00
- Open the extension Options page; it validates relay reachability + gateway-token auth.
2026-01-15 05:20:56 +00:00
2026-01-27 03:23:42 +00:00
## Remote Gateway (use a node host)
2026-01-15 05:15:33 +00:00
2026-01-27 03:23:42 +00:00
### Local Gateway (same machine as Chrome) — usually **no extra steps**
2026-01-15 05:15:33 +00:00
2026-01-27 03:23:42 +00:00
If the Gateway runs on the same machine as Chrome, it starts the browser control service on loopback
and auto-starts the relay server. The extension talks to the local relay; the CLI/tool calls go to the Gateway.
2026-01-15 05:15:33 +00:00
2026-01-27 03:23:42 +00:00
### Remote Gateway (Gateway runs elsewhere) — **run a node host**
2026-01-15 05:15:33 +00:00
2026-01-27 03:23:42 +00:00
If your Gateway runs on another machine, start a node host on the machine that runs Chrome.
The Gateway will proxy browser actions to that node; the extension + relay stay local to the browser machine.
2026-01-15 05:15:33 +00:00
2026-01-27 03:23:42 +00:00
If multiple nodes are connected, pin one with `gateway.nodes.browser.node` or set `gateway.nodes.browser.mode` .
2026-01-15 05:15:33 +00:00
2026-01-15 05:17:12 +00:00
## Sandboxing (tool containers)
If your agent session is sandboxed (`agents.defaults.sandbox.mode != "off"` ), the `browser` tool can be restricted:
- By default, sandboxed sessions often target the **sandbox browser** (`target="sandbox"` ), not your host Chrome.
- Chrome extension relay takeover requires controlling the **host** browser control server.
Options:
2026-01-31 21:13:13 +09:00
2026-01-15 05:17:12 +00:00
- Easiest: use the extension from a **non-sandboxed** session/agent.
- Or allow host browser control for sandboxed sessions:
```json5
{
agents: {
defaults: {
sandbox: {
browser: {
2026-01-31 21:13:13 +09:00
allowHostControl: true,
},
},
},
},
2026-01-15 05:17:12 +00:00
}
```
Then ensure the tool isn’ t denied by tool policy, and (if needed) call `browser` with `target="host"` .
2026-01-30 03:15:10 +01:00
Debugging: `openclaw sandbox explain`
2026-01-15 05:17:12 +00:00
2026-01-27 03:23:42 +00:00
## Remote access tips
2026-01-15 04:50:11 +00:00
2026-01-27 03:23:42 +00:00
- Keep the Gateway and node host on the same tailnet; avoid exposing relay ports to LAN or public Internet.
- Pair nodes intentionally; disable browser proxy routing if you don’ t want remote control (`gateway.nodes.browser.mode="off"` ).
2026-03-08 19:14:59 +00:00
- Leave the relay on loopback unless you have a real cross-namespace need. For WSL2 or similar split-host setups, set `browser.relayBindHost` to an explicit bind address such as `0.0.0.0` , then keep access constrained with Gateway auth, node pairing, and a private network.
2026-01-15 04:50:11 +00:00
## How “extension path” works
2026-01-30 03:15:10 +01:00
`openclaw browser extension path` prints the **installed** on-disk directory containing the extension files.
2026-01-15 04:50:11 +00:00
2026-01-30 03:15:10 +01:00
The CLI intentionally does **not** print a `node_modules` path. Always run `openclaw browser extension install` first to copy the extension to a stable location under your OpenClaw state directory.
2026-01-15 04:50:11 +00:00
If you move or delete that install directory, Chrome will mark the extension as broken until you reload it from a valid path.
## Security implications (read this)
This is powerful and risky. Treat it like giving the model “hands on your browser”.
- The extension uses Chrome’ s debugger API (`chrome.debugger` ). When attached, the model can:
- click/type/navigate in that tab
- read page content
- access whatever the tab’ s logged-in session can access
2026-01-30 03:15:10 +01:00
- **This is not isolated** like the dedicated openclaw-managed profile.
2026-01-15 04:50:11 +00:00
- If you attach to your daily-driver profile/tab, you’ re granting access to that account state.
Recommendations:
2026-01-31 21:13:13 +09:00
2026-01-15 04:50:11 +00:00
- Prefer a dedicated Chrome profile (separate from your personal browsing) for extension relay usage.
2026-01-27 03:23:42 +00:00
- Keep the Gateway and any node hosts tailnet-only; rely on Gateway auth + node pairing.
- Avoid exposing relay ports over LAN (`0.0.0.0` ) and avoid Funnel (public).
2026-02-19 08:39:34 +01:00
- The relay blocks non-extension origins and requires gateway-token auth for both `/cdp` and `/extension` .
2026-01-15 04:50:11 +00:00
Related:
2026-01-31 21:13:13 +09:00
2026-01-15 04:50:11 +00:00
- Browser tool overview: [Browser ](/tools/browser )
- Security audit: [Security ](/gateway/security )
- Tailscale setup: [Tailscale ](/gateway/tailscale )