Browser Rules Skill(浏览器使用规则)
📖 技能定义
Browser Rules是AI龙龟共生伙伴操作系统的浏览器使用规则,区分登录会话用浏览器和自动化用隔离浏览器,确保合适的工具用于合适的场景。
核心定位:---
🎯 浏览器配置
1. Chrome浏览器中继(登录会话)
配置信息: ```yaml chrome_profile: name: chrome type: login_session description: 用于访问需要登录会话的网站 path: /path/to/chrome/profile ``` 使用场景:options = Options() options.add_argument(f"--user-data-dir=/path/to/chrome/profile") options.add_argument("--profile-directory=Default")
driver = webdriver.Chrome(options=options) driver.get("https://twitter.com") # 自动登录 ```
注意事项:2. 隔离浏览器(自动化任务)
配置信息: ```yaml openclaw_profile: name: openclaw type: automation description: 用于通用网页自动化任务 path: /path/to/openclaw/profile clean_session: true # 每次启动都是新会话 ``` 使用场景:options = Options() options.add_argument(f"--user-data-dir=/path/to/openclaw/profile") options.add_argument("--incognito") # 隐身模式
driver = webdriver.Chrome(options=options) driver.get("https://example.com") # 无登录状态
执行自动化任务
``` 注意事项:---
🔧 使用策略
1. 场景选择
使用Chrome浏览器中继(`profile="chrome"`):2. 决策流程
``` 需要访问网站 ↓ 需要登录? ↓ 是 → 使用Chrome浏览器中继(profile="chrome") ↓ 否 ↓ 自动化任务? ↓ 是 → 使用隔离浏览器(profile="openclaw") ↓ 否 ↓ 使用正常浏览器(用户手动操作) ```
3. 混合使用场景
场景1:登录后抓取数据 ```python第一步:使用Chrome浏览器中继登录
chrome_driver = get_chrome_profile("chrome") chrome_driver.get("https://example.com/login")登录操作...
第二步:使用隔离浏览器抓取数据
openclaw_driver = get_chrome_profile("openclaw") openclaw_driver.get("https://example.com/data")抓取数据...
``` 场景2:多账户操作 ```python账户1
driver1 = get_chrome_profile("chrome_account1") driver1.get("https://twitter.com")操作账户1...
账户2
driver2 = get_chrome_profile("chrome_account2") driver2.get("https://twitter.com")操作账户2...
```---
🛡️ 安全管理
1. 会话隔离
隔离原则:2. 敏感信息保护
禁止事项:3. 浏览器权限
权限控制: ```yaml permissions: chrome_profile: cookies: allow local_storage: allow session_storage: allow extensions: allowopenclaw_profile: cookies: deny local_storage: deny session_storage: deny extensions: deny ```
---
📊 使用监控
1. 使用统计
每日统计: ```yaml browser_usage: date: 2026-03-23 total_sessions: 50 by_profile: chrome: 20 chrome_account1: 10 openclaw: 15 openclaw_test: 5 by_type: login_session: 30 automation: 20 ```2. 性能监控
关键指标:---
🔄 与其他Skills的协同
1. 与推荐工具清单Skill协同
2. 与心跳巡检Skill协同
3. 与工具档案Skill协同
---
🚫 使用禁忌
1. 不要做的
2. 必须做的
---
💡 最佳实践
1. Profile管理
命名规范:2. 会话管理
登录会话:3. 性能优化
启动优化:---
🎯 核心原则总结
三大铁律
1. 隔离管理 - 不同场景使用不同profile - 登录会话和自动化任务隔离 - 避免交叉干扰
2. 会话保持 - 登录会话保持状态 - 自动化会话不保存状态 - 定期清理敏感信息
3. 性能监控 - 监控浏览器性能 - 及时优化调整 - 避免资源浪费
核心价值
---
🔧 实施路线
第一阶段:基础配置(立即)
第二阶段:功能实现(本周)
第三阶段:优化完善(本月)
---
版本: v1.0 创建日期: 2026-03-23 对标来源: OpenClaw Browser Rules规则 AI龙龟共生伙伴操作系统版本: v4.1 路径: `C:\Users\jia'yue\.workbuddy\skills\浏览器使用规则\SKILL.md`