agent-browser-helper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagent-browser-helper
agent-browser-helper
Manages a local Chrome instance with anti-detection parameters and persistent
profiles. After starting Chrome, use the agent-browser skill to operate it.
通过带有反检测参数和持久化配置文件的本地Chrome实例进行管理。启动Chrome后,使用agent-browser技能对其进行操作。
Prerequisites
前提条件
- agent-browser skill:
npx skills add vercel-labs/agent-browser@agent-browser -g -y - agent-browser CLI:
npm i -g agent-browser && agent-browser install - Google Chrome or Chromium installed
IMPORTANT: The agent-browser skill must be installed for the AI agent
to know how to operate the browser. Without it, the agent has no command
reference and will guess incorrectly. Check output — if it
shows a warning about missing skill, install it first.
chrome.sh start- agent-browser技能:
npx skills add vercel-labs/agent-browser@agent-browser -g -y - agent-browser CLI:
npm i -g agent-browser && agent-browser install - 已安装Google Chrome或Chromium
重要提示: 必须安装agent-browser skill,AI Agent才能知晓如何操作浏览器。如果没有该技能,Agent将没有命令参考,会做出错误的猜测。请检查的输出——如果显示缺少skill的警告,请先安装它。
chrome.sh startWorkflow
工作流程
Step 1: Start Chrome
步骤1:启动Chrome
bash
bash $SCRIPTS/chrome.sh startOutput example:
json
{"status":"started","pid":12345,"cdpPort":9222,"profile":"default","userDataDir":"~/.agent-browser-helper/default/user-data"}Read the output carefully — it tells you the CDP port and which profile
is active. The profile's user-data-dir persists login state across sessions.
bash
bash $SCRIPTS/chrome.sh start输出示例:
json
{"status":"started","pid":12345,"cdpPort":9222,"profile":"default","userDataDir":"~/.agent-browser-helper/default/user-data"}请仔细阅读输出内容——它会告知你CDP端口以及当前激活的配置文件。配置文件的user-data-dir会在会话之间保留登录状态。
Step 2: Load agent-browser documentation
步骤2:加载agent-browser文档
MUST DO before running any agent-browser command. Run:
bash
agent-browser skills get coreThis outputs the correct command syntax. Do NOT guess commands — they use
non-standard conventions (e.g., not , positional args not
flags). If this command fails, the CLI is not installed.
opennavigate--url在运行任何agent-browser命令之前必须执行此操作。运行:
bash
agent-browser skills get core此命令会输出正确的命令语法。请勿猜测命令——它们使用非标准约定(例如使用而非,使用位置参数而非标志)。如果此命令执行失败,说明CLI未安装。
opennavigate--urlStep 3: Operate via agent-browser
步骤3:通过agent-browser进行操作
Connect using the CDP port from Step 1:
bash
agent-browser open <url> --cdp 9222All subsequent commands in the same session inherit the CDP connection.
使用步骤1中的CDP端口建立连接:
bash
agent-browser open <url> --cdp 9222同一会话中的所有后续命令都会继承该CDP连接。
Commands
命令
= this skill's$SCRIPTSabsolute path.scripts/
= 此skill的$SCRIPTS绝对路径。scripts/
start
start
bash
bash $SCRIPTS/chrome.sh start # default profile, headed, port 9222
bash $SCRIPTS/chrome.sh start --profile work # named profile (isolated user-data)
bash $SCRIPTS/chrome.sh start --headless # headless (default is HEADED)
bash $SCRIPTS/chrome.sh start --port 9333 # custom CDP portbash
bash $SCRIPTS/chrome.sh start # 默认配置文件,有界面,端口9222
bash $SCRIPTS/chrome.sh start --profile work # 命名配置文件(独立的用户数据)
bash $SCRIPTS/chrome.sh start --headless # 无头模式(默认是有界面模式)
bash $SCRIPTS/chrome.sh start --port 9333 # 自定义CDP端口stop
stop
bash
bash $SCRIPTS/chrome.sh stop
bash $SCRIPTS/chrome.sh stop --profile workbash
bash $SCRIPTS/chrome.sh stop
bash $SCRIPTS/chrome.sh stop --profile workstatus
status
bash
bash $SCRIPTS/chrome.sh statusbash
bash $SCRIPTS/chrome.sh statusProfile system
配置文件系统
Each profile has its own isolated user-data directory:
~/.agent-browser-helper/{profile}/user-dataThis means:
- Cookies, localStorage, sessions persist across browser restarts
- Extensions installed in a profile stay installed
- Login state survives — no need to re-authenticate every time
- Different profiles are fully isolated (different ports, different data)
When to use named profiles:
- — keep XHS login separate
--profile xiaohongshu - — corporate SSO sessions
--profile work - — fresh profile for testing
--profile clean
Important: If the user has previously logged into a site, remind them
which profile contains that session. Don't start a new unnamed profile and
lose their login state.
每个配置文件都有自己独立的用户数据目录:
~/.agent-browser-helper/{profile}/user-data这意味着:
- Cookie、localStorage、会话会在浏览器重启后保留
- 配置文件中安装的扩展会保持安装状态
- 登录状态会保留——无需每次重新验证
- 不同的配置文件完全独立(不同的端口,不同的数据)
何时使用命名配置文件:
- — 保留小红书的独立登录状态
--profile xiaohongshu - — 企业SSO会话
--profile work - — 用于测试的全新配置文件
--profile clean
重要提示: 如果用户之前已登录某个网站,请提醒他们哪个配置文件包含该会话。不要启动新的未命名配置文件,以免丢失登录状态。
Configuration
配置
Edit in the skill directory:
config.jsonjson
{
"browser": {
"headless": false,
"noSandbox": true,
"defaultProfile": "default",
"extraArgs": [
"--disable-blink-features=AutomationControlled",
"--disable-infobars",
"--window-size=1280,720"
],
"profiles": {
"default": { "cdpPort": 9222 }
}
}
}编辑skill目录下的:
config.jsonjson
{
"browser": {
"headless": false,
"noSandbox": true,
"defaultProfile": "default",
"extraArgs": [
"--disable-blink-features=AutomationControlled",
"--disable-infobars",
"--window-size=1280,720"
],
"profiles": {
"default": { "cdpPort": 9222 }
}
}
}Profile options
配置文件选项
| Field | Description | Default |
|---|---|---|
| CDP debugging port | 9222 |
| Custom user data directory | |
| 字段 | 描述 | 默认值 |
|---|---|---|
| CDP调试端口 | 9222 |
| 自定义用户数据目录 | |
extraArgs for anti-detection
用于反检测的extraArgs参数
| Arg | Purpose | Default |
|---|---|---|
| Hide | ✅ on |
| Remove automation info bar | ✅ on |
| Normal viewport (avoids 800x600 fingerprint) | ✅ on |
| HTTP proxy | off |
| Browser language | off |
| Custom User-Agent | off |
| 参数 | 用途 | 默认状态 |
|---|---|---|
| 隐藏 | ✅ 开启 |
| 移除自动化信息栏 | ✅ 开启 |
| 标准视口(避免800x600的指纹特征) | ✅ 开启 |
| HTTP代理 | 关闭 |
| 浏览器语言 | 关闭 |
| 自定义User-Agent | 关闭 |
Anti-detection defaults
反检测默认设置
Out of the box, this skill applies:
- No —
--enable-automationreturnsnavigator.webdriverundefined - — removes CDP automation markers
--disable-blink-features=AutomationControlled - — no "Chrome is being controlled" banner
--disable-infobars - — normal desktop viewport
--window-size=1280,720 - Headed mode — headless browsers have distinct fingerprints
- Persistent profile — real cookies/history make the browser look "lived-in"
- No Playwright/Puppeteer in launch path — no extra automation flags injected
For sites with aggressive detection (Cloudflare, DataDome), consider also adding
a real User-Agent string and proxy to .
extraArgs开箱即用,此skill会应用以下设置:
- 不添加—
--enable-automation返回navigator.webdriverundefined - — 移除CDP自动化标记
--disable-blink-features=AutomationControlled - — 无“Chrome正被控制”提示横幅
--disable-infobars - — 标准桌面视口
--window-size=1280,720 - 有界面模式 — 无头浏览器具有独特的指纹特征
- 持久化配置文件 — 真实的Cookie/历史记录让浏览器看起来“经常使用”
- 启动路径中无Playwright/Puppeteer — 不会注入额外的自动化标志
对于检测严格的网站(如Cloudflare、DataDome),建议在中添加真实的User-Agent字符串和代理。
extraArgs