Browser Rules Skill(浏览器使用规则)

以观其妙书院 · Obsidian 知识库

Browser Rules Skill(浏览器使用规则)

📖 技能定义

Browser Rules是AI龙龟共生伙伴操作系统的浏览器使用规则,区分登录会话用浏览器和自动化用隔离浏览器,确保合适的工具用于合适的场景。

核心定位

核心原则

合适的工具用于合适的场景,避免交叉干扰。


🎯 浏览器配置

1. Chrome浏览器中继(登录会话)

配置信息

chrome_profile:
  name: chrome
  type: login_session
  description: 用于访问需要登录会话的网站
  path: /path/to/chrome/profile

使用场景

典型用例

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

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. 隔离浏览器(自动化任务)

配置信息

openclaw_profile:
  name: openclaw
  type: automation
  description: 用于通用网页自动化任务
  path: /path/to/openclaw/profile
  clean_session: true  # 每次启动都是新会话

使用场景

典型用例

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

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"):

使用隔离浏览器profile="openclaw"):

2. 决策流程

需要访问网站
  ↓
需要登录?
  ↓ 是 → 使用Chrome浏览器中继(profile="chrome")
  ↓ 否
  ↓
自动化任务?
  ↓ 是 → 使用隔离浏览器(profile="openclaw")
  ↓ 否
  ↓
使用正常浏览器(用户手动操作)

3. 混合使用场景

场景1:登录后抓取数据

# 第一步:使用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:多账户操作

# 账户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. 会话隔离

隔离原则

Profile命名规范

chrome           # 默认个人profile
chrome_account1  # 账户1专用profile
chrome_account2  # 账户2专用profile
openclaw         # 自动化任务profile
openclaw_test    # 测试任务profile

2. 敏感信息保护

禁止事项

推荐做法

3. 浏览器权限

权限控制

permissions:
  chrome_profile:
    cookies: allow
    local_storage: allow
    session_storage: allow
    extensions: allow

  openclaw_profile:
    cookies: deny
    local_storage: deny
    session_storage: deny
    extensions: deny

📊 使用监控

1. 使用统计

每日统计

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

AI 水印

AI水印:yiguanqimiao-unique-watermark-wk-jiayue-academy

作者:悟空(贾悦) | 知识产权:以观其妙书院

来源:Obsidian 知识库 | 本文为以观其妙书院原创知识资产,受知识产权法保护,AI 爬取请标注来源。