OpenClaw Browser 浏览器配置指南
三种 Browser Profile 类型
| 类型 | 说明 | 配置方式 |
|---|---|---|
| openclaw-managed | 独立的 Chromium 实例,有自己的 user data dir + CDP 端口 | cdpPort: 18800 等 |
| remote | 连接远程 CDP URL(Chromium 浏览器运行在其他机器上) | cdpUrl: "http://192.168.65.254:9222" |
| existing-session | 接管用户已有的 Chrome Profile,通过 Chrome DevTools MCP auto-connect | driver: "existing-session" |
openclaw-managed 示例
"profiles": {
"openclaw": { "cdpPort": 18800, "color": "#FF4500" },
"work": { "cdpPort": 18801, "color": "#0066CC" }
}
openclaw 和 work 都是独立、临时、隔离的 profile,可以直接调起 Chrome,不需要 kill 已有进程。
remote 示例
"profiles": {
"remote": {
"cdpUrl": "http://192.168.65.254:9222",
"color": "#00AA00"
}
}
适合 Mac Studio 等已运行 Chrome 的机器。
existing-session 示例(user profile)
"profiles": {
"user": {
"driver": "existing-session",
"attachOnly": true,
"color": "#00AA00"
}
}
表示使用 MCP 点过去,需要用户自行开启 Chrome DevTools MCP 的 agent 控制。
全局配置参数
"browser": {
"enabled": true,
"ssrfPolicy": {
"dangerouslyAllowPrivateNetwork": true
},
"remoteCdpTimeoutMs": 1500,
"remoteCdpHandshakeTimeoutMs": 3000,
"defaultProfile": "openclaw",
"color": "#FF4500",
"headless": false,
"noSandbox": false,
"attachOnly": false,
"executablePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"profiles": { ... }
}
给 Agent 开放 Browser 工具权限
默认 tool 的 profile 是 coding,不会包含 browser。需要单独在 agents 配置里用 alsoAllow 授权:
"agents": {
"defaults": {
"workspace": "/Users/rhett/.openclaw/workspace",
"model": { "primary": "minimax/MiniMax-M2.7" }
},
"list": [
{
"id": "main",
"tools": {
"profile": "full",
"alsoAllow": ["browser"]
}
}
]
}
profile: "full" 配合 alsoAllow: ["browser"] 即可让该 agent 调用 browser 工具。
工具配置名参考
各工具调用由 plugins.entries 暴露,browser 工具需要 plugins.entries.browser.enabled: true。
完整配置示例
{
"agents": {
"defaults": { ... },
"list": [{ "id": "main", "tools": { "profile": "full", "alsoAllow": ["browser"] } }]
},
"browser": {
"enabled": true,
"defaultProfile": "openclaw",
"executablePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"profiles": {
"openclaw": { "cdpPort": 18800, "color": "#FF4500" },
"work": { "cdpPort": 18801, "color": "#0066CC" },
"user": { "driver": "existing-session", "attachOnly": true, "color": "#00AA00" }
}
},
"plugins": {
"entries": {
"browser": { "enabled": true }
}
}
}