Best use case
browser-profile-guide is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
OpenClaw Browser 配置文件系统完全指南 — 哪个 profile 何时用、如何选
Teams using browser-profile-guide should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/browser-profile-guide/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How browser-profile-guide Compares
| Feature / Agent | browser-profile-guide | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
OpenClaw Browser 配置文件系统完全指南 — 哪个 profile 何时用、如何选
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# OpenClaw Browser Profile 完整指南
## 三种 Profile 用途速查
| Profile | 驱动 | 登录态 | 何时用 | 是否需要手动开浏览器 |
|---------|------|--------|--------|-------------------|
| `openclaw`(默认) | Playwright + Chrome CDP | ❌ 全新干净浏览器 | 自动化、批量操作、不需要登录 | ❌ 自动启动 |
| `user` | Playwright + Chrome CDP | ✅ 复用你已有的 Chrome 登录态 | 需要 GitHub/邮箱等已登录网站 | ✅ 需先手动开 Chrome |
| `sandbox` | Docker 内 Playwright | ❌ 隔离容器内全新浏览器 | 安全敏感操作 | ❌ 自动启动 |
## 你的当前配置(~/.openclaw/openclaw.json)
```json
"browser": {
"headless": false,
"noSandbox": true,
"profiles": {
"user": {
"attachOnly": true, // 只连接已开的浏览器,不自动启动
"cdpPort": 9222, // Chrome 远程调试端口
"driver": "openclaw",
"color": "#00AA00"
}
}
}
```
**注意**:`openclaw` profile 没有显式定义,但是**默认 profile**,OpenClaw 会自动创建。
## 默认 Profile:`openclaw`(最常用)
```javascript
browser(action="open", profile="openclaw", url="https://github.com")
browser(action="snapshot", profile="openclaw")
browser(action="act", profile="openclaw", ref="e1", kind="click")
```
- OpenClaw 自动管理浏览器生命周期
- 每次启动是干净的浏览器环境
- CDP 端口:18800(`openclaw profile`)
## `user` Profile — 复用已有登录态
**前置条件**:你必须先手动打开 Chrome 并启用远程调试
```bash
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/Library/Application Support/Google/Chrome"
# Linux
google-chrome --remote-debugging-port=9222
```
**你的配置里 `user` profile 已设为 `attachOnly: true`**,意味着:
- 如果 Chrome 没开 → 不会自动启动 → 会报错
- Chrome 开着且端口 9222 在监听 → 自动连接
```javascript
// 需要登录 GitHub?用 user profile
browser(action="open", profile="user", url="https://github.com")
browser(action="snapshot", profile="user")
```
## 统一规则(你们团队所有人遵守)
```
任务需要登录网站(GitHub/邮箱/社交媒体)
→ profile="user" + 先手动开 Chrome --remote-debugging-port=9222
普通自动化、批量操作、无需登录
→ profile="openclaw"(默认,可省略 profile 参数)
```
## CDP 直连模式(更快)
当前配置已有 `chromeCdp` 模式(`browser.chromeCdp: true`),这让 OpenClaw 直接用 Chrome DevTools Protocol,绕过 Playwright 的额外开销。
## 常用操作示例
```javascript
// 1. 普通自动化(用默认 openclaw profile)
browser(action="open", url="https://example.com")
browser(action="snapshot")
// 2. 需要登录的网站
browser(action="open", profile="user", url="https://github.com/settings/applications")
browser(action="snapshot")
// 3. 截图
browser(action="screenshot", fullPage=true)
// 4. 复杂交互(先用 snapshot 获取 refs)
browser(action="snapshot")
// → 拿到 @e1, @e2 等 refs
browser(action="act", ref="e1", kind="click")
browser(action="act", ref="e3", kind="type", text="hello world")
// 5. PDF 导出
browser(action="pdf")
```
## 故障排除
| 问题 | 解决 |
|------|------|
| `profile="user"` 报错 "browser not running" | 先手动开 Chrome:`google-chrome --remote-debugging-port=9222` |
| `profile="openclaw"` 报错 "CDP not reachable" | 重启 Gateway:`openclaw gateway restart` |
| 浏览器开着但连不上 | 检查端口:`lsof -i :9222`,确认是 Chrome 在监听 |
| 截图是空白页 | 加 `loadState="networkidle"` 等待网络空闲 |Related Skills
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
tdd-guide
Test-driven development workflow with test generation, coverage analysis, and multi-framework support
style-guide-generator
Generate comprehensive website style guides and design systems from URLs, screenshots, and existing documentation. Use this skill when users ask to create a style guide, design system documentation, brand guidelines document, or design specification from a website, app, or existing materials. This skill produces professional PDF outputs following industry-standard style guide structure.
openclaw-browser-chain-debug
Diagnose OpenClaw browser control failures including browser start timeouts, Chrome CDP startup failures, missing DISPLAY, browser profile launch issues, and gateway/browser environment mismatches. Use when browser automation, browser-based cron jobs, or profile openclaw fails to start, times out, or returns Request was aborted after browser steps. Also use when deciding whether a task should run with a profile browser versus an attach browser: prefer profile for unattended automation and recurring jobs; prefer attach when a human's already-open logged-in tab or manual cooperation is required.
fast-browser-use
Use when the user wants extremely fast browser automation via fast-browser-use / fbu, especially for DOM-heavy pages, fast extraction, or browser tasks on macOS/Linux with Chrome installed.
codex-cc-guide
如何用 ACP sessions_spawn 调用 Claude Code / Codex 写代码 — 小code 团队编码任务指南
browser-use
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
browser-login-monitor
> 浏览器登录安全监控——监测浏览器会话状态与登录安全
brand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Agent Browser
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
wemp-operator
> 微信公众号全功能运营——草稿/发布/评论/用户/素材/群发/统计/菜单/二维码 API 封装
zsxq-smart-publish
Publish and manage content on 知识星球 (zsxq.com). Supports talk posts, Q&A, long articles, file sharing, digest/bookmark, homework tasks, and tag management. Use when publishing content to 知识星球, creating/editing posts, uploading files/images/audio, managing digests, batch publishing, or formatting content for 知识星球.