本文介绍如何通过简单配置,让 OpenClaw 使用内置浏览器,彻底告别插件安装提示。
为什么你需要这篇教程?
使用 OpenClaw 的同学可能遇到过这样的困扰:每次执行浏览器操作时,系统总是弹出提示让你安装浏览器插件。
但其实,OpenClaw 早就内置了自己的浏览器功能,根本不需要额外装插件!
一行配置:
browser.defaultProfile: "openclaw"即可启用内置浏览器。
配置后
![]()
核心配置
在 OpenClaw 的配置文件中添加一行(~/.openclaw/openclaw.json):
{
"browser": {
"defaultProfile": "openclaw"
}
}
什么是 OpenClaw 内置浏览器?
OpenClaw 内置了一个专门为 AI 助手优化的浏览器环境,隔离于你的日常浏览器。
官方描述:
Think of it as a separate, agent-only browser.
The
openclawprofile does not touch your personal browser profile.— OpenClaw 官方文档
核心特点
| 特点 | 说明 |
|---|---|
| 🔧 开箱即用 | 无需安装任何插件 |
| 🔗 原生集成 | 与 OpenClaw 深度整合,操作更流畅 |
| 🔒 隐私安全 | 数据本地处理,不依赖第三方插件 |
| 🖥️ 跨平台一致 | Windows、Mac、Linux 体验一致 |
| 🛡️ 隔离安全 | 使用独立 profile,不影响日常浏览器 |
浏览器 对比:openclaw vs chrome
了解两种 profile 的区别,选择最适合你的方案。
| 浏览器 | 类型 | 官方说明 |
|---|---|---|
openclaw | 托管隔离浏览器 | managed, isolated browser (no extension required) |
chrome | 系统浏览器扩展 | extension relay to your system browser |
官方建议
Set
browser.defaultProfile: "openclaw"if you want managed mode by default.— OpenClaw 官方文档
对比详解
| 对比项 | openclaw | chrome |
|---|---|---|
| 是否需要插件 | ❌ 不需要 | ✅ 需要扩展 |
| 数据隔离 | ✅ 完全独立 | ⚠️ 复用系统数据 |
| 推荐场景 | 通用自动化 | 需复用已登录状态 |
| 安全等级 | 🛡️ 更高 | ⚠️ 需注意 |
🔐 登录的正确方式
重要安全提醒:官网明确警告 不要把账号密码给 OpenClaw。
✅ 正确方式:手动登录
官方原文:
When a site requires login, sign in manually in the host browser profile (the openclaw browser).
Do not give the model your credentials. Automated logins often trigger anti-bot defenses and can lock the account.
— OpenClaw 官方文档
正确步骤:
- 使用
browser工具让 OpenClaw 打开目标网站 - 👤 你亲自在浏览器中输入账号密码登录
- 💾 登录状态保存在
openclawprofile,后续自动保持
# 示例
browser.open url="https://example.com"
# 然后手动登录
❌ 错误方式:告诉 AI 密码
官网明确警告:
Do not give the model your credentials.
把密码告诉 AI 的风险:
| 风险 | 官方说明 |
|---|---|
| 🚫 触发反爬虫 | Automated logins often trigger anti-bot defenses and can lock the account. |
| 🔓 安全风险 | 账号密码暴露给 AI 模型 |
| 🔢 二次验证 | AI 无法通过验证码 |
隔离保证
OpenClaw 内置浏览器与你的日常浏览器完全隔离,安全可控。
官方原文
Dedicated user data dir: never touches your personal browser profile.
Dedicated ports: avoids
9222to prevent collisions with dev workflows.Deterministic tab control: target tabs by
targetId, not "last tab".
数据存储位置
| 浏览器 | 数据路径 | 用途 |
|---|---|---|
openclaw | OpenClaw 自有数据目录 | AI 自动化专用 |
chrome | 系统 Chrome 数据目录 | 复用已登录状态 |
sandbox | 临时目录 | 隔离测试,退出清除 |
切换 浏览器 后,之前的登录状态不会继承。
安全与隐私
官方文档特别强调的安全要点:
The openclaw browser profile may contain logged-in sessions; treat it as sensitive.
官方原文
Security & privacy:
- The openclaw browser profile may contain logged-in sessions; treat it as sensitive.
browser act kind=evaluateexecutes arbitrary JavaScript. Prompt injection can steer this. Disable it withbrowser.evaluateEnabled=falseif you do not need it.- For logins and anti-bot notes (X/Twitter, etc.), see Browser login + X/Twitter posting.
- Keep the Gateway/node host private (loopback or tailnet-only).
- Remote CDP endpoints are powerful; tunnel and protect them.
安全建议
| 建议 | 说明 |
|---|---|
| ✅ treat as sensitive | 内置浏览器的登录状态是敏感数据 |
| ✅ 保持私密 | Gateway/node host 应保持私密 |
| ⚠️ 谨慎使用 evaluate | JS 执行可能被提示注入攻击 |
| 🔗 使用 HTTPS | 远程 CDP 优先使用 HTTPS |
常见问题
| Q: 配置后需要重启 OpenClaw 吗? |
|---|
| 需要重启配置才能生效。 |
| Q: 切换 浏览器 后之前的登录状态还在吗? |
|---|
| 不同 浏览器 数据独立,切换后需要重新登录。 |
| Q: 为什么有时还是提示安装插件? |
|---|
| 检查配置是否正确保存,或尝试重启 OpenClaw。 |
| Q: 可以把密码告诉 AI 吗? |
|---|
绝对不要! 官网警告:Do not give the model your credentials. |
| Q: 如何清除登录状态? |
|---|
删除对应 浏览器 的数据目录,或使用 sandbox 浏览器。 |
| Q: OpenClaw 会访问我的日常浏览数据吗? |
|---|
不会。官方:The openclaw profile does not touch your personal browser profile. |
Q: 为什么要用 openclaw 而不是 chrome? |
|---|
官方推荐:switch to openclaw for the isolated managed browser. |
总结
OpenClaw 内置浏览器开箱即用、安全隔离,只需一行配置即可告别插件困扰。
核心要点
| 要点 | 官方建议 |
|---|---|
✅ 使用 openclaw 浏览器 | Set browser.defaultProfile: "openclaw" |
| ✅ 手动登录 | Sign in manually in the host browser profile |
| ❌ 不要给 AI 密码 | Do not give the model your credentials |
| ✅ 隔离安全 | The openclaw profile does not touch your personal browser profile |
参考文档
| 文档 | 链接 | 关键章节 |
|---|---|---|
| Browser (OpenClaw-managed) | docs.openclaw.ai/tools/brows… | Profiles、Isolation guarantees、Security & privacy |
| Browser Login | docs.openclaw.ai/tools/brows… | Manual login (recommended)、Why not automate logins? |
如果你有其他 OpenClaw 使用问题,欢迎在评论区交流讨论!