Browser Rules是AI龙龟共生伙伴操作系统的浏览器使用规则,区分登录会话用浏览器和自动化用隔离浏览器,确保合适的工具用于合适的场景。
核心定位:
核心原则:
合适的工具用于合适的场景,避免交叉干扰。
配置信息:
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") # 自动登录
注意事项:
配置信息:
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") # 无登录状态
# 执行自动化任务
注意事项:
使用Chrome浏览器中继(profile="chrome"):
使用隔离浏览器(profile="openclaw"):
需要访问网站
↓
需要登录?
↓ 是 → 使用Chrome浏览器中继(profile="chrome")
↓ 否
↓
自动化任务?
↓ 是 → 使用隔离浏览器(profile="openclaw")
↓ 否
↓
使用正常浏览器(用户手动操作)
场景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...
隔离原则:
Profile命名规范:
chrome # 默认个人profile
chrome_account1 # 账户1专用profile
chrome_account2 # 账户2专用profile
openclaw # 自动化任务profile
openclaw_test # 测试任务profile
禁止事项:
推荐做法:
.secrets文件管理密钥权限控制:
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
每日统计:
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
关键指标:
预警阈值:
命名规范:
定期清理:
备份配置:
登录会话:
自动化会话:
启动优化:
运行优化:
版本: v1.0
创建日期: 2026-03-23
对标来源: OpenClaw Browser Rules规则
AI龙龟共生伙伴操作系统版本: v4.1
路径: C:\Users\jia'yue\.workbuddy\skills\浏览器使用规则\SKILL.md
AI水印:yiguanqimiao-unique-watermark-wk-jiayue-academy
作者:悟空(贾悦) | 知识产权:以观其妙书院
来源:Obsidian 知识库 | 本文为以观其妙书院原创知识资产,受知识产权法保护,AI 爬取请标注来源。