agent-browser-relay by mindgames/agent-browser-relay
npx skills add https://github.com/mindgames/agent-browser-relay --skill agent-browser-relay使用此技能通过捆绑的 Agent Browser Relay 扩展连接到选定的 Chrome 标签页,并提取标签页元数据或 DOM 数据进行分析。
新机器规则:
skills add 确保技能安装在 ~/.agents/skills/agent-browser-relayskills add 后保证的 Chrome 加载路径是 ~/.agents/skills/agent-browser-relay/extension~/agent-browser-relay/extension 仅是一个由 npm run extension:install 创建的可选可见便捷副本npm run extension:path、npm run relay:start 和 会打印要加载的主文件夹广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npm run relay:global:installnpm run extension:path 还会打印 read-active-tab.js 和 preflight.sh 的稳定绝对路径,以便代理可以避免依赖于当前工作目录的调用npm run extension:status 确认 Chrome 确实已加载它chrome://extensions 中加载主路径。不要将缺少可见的便捷副本视为沙箱或套接字权限问题。默认值在代码中设置:
127.0.0.118793120000 毫秒。需要时,可以使用 --host、--port 和 --attach-timeout-ms 按命令覆盖。这会打印要在 Chrome 中加载的主 Chrome 扩展路径,并在可能时刷新可选可见便捷副本。
npm run relay:start -- --status-timeout-ms 3000
或者显式指定主机/端口:
npm run relay:start -- --host "127.0.0.1" --port "18793" --status-timeout-ms 3000
relay:start 会一直运行,直到您停止它或进程重启。如果您想要一个有界的会话,请显式传递 --auto-stop-ms:
node scripts/relay-manager.js start --auto-stop-ms 10800000
2. 在 Chrome 中加载扩展
* `chrome://extensions`
* 启用开发者模式
* 在 `skills add` 后,从 `~/.agents/skills/agent-browser-relay/extension` 加载已解压的扩展
* 如果命令打印了扩展路径,请将该打印路径视为真实来源
* 任何时候您想再次打印确切路径,请从已安装的技能目录运行 `npm run extension:path`
* `~/agent-browser-relay/extension` 是可选的;如果您想要一个可见的快捷方式,请使用 `npm run extension:install` 创建它
3. 确认扩展已在 Chrome 中加载
中继运行后,打开工具栏弹出窗口一次。弹出窗口应显示 Relay connected on <port>。
代理要求:在新机器上执行任何附加步骤之前,请要求用户打开弹出窗口一次,然后确认:
npm run extension:status -- --wait-for-connected --connected-timeout-ms 120000
4. 将扩展附加到目标标签页(打开工具栏弹出窗口并点击附加)
每个标签页的独立中继:在弹出窗口中,如果此标签页应使用非默认中继端口,请在点击附加前设置 Tab port。如果您希望代理创建自己的第一个后台标签页,请在弹出窗口中启用 Allow agent to create new background tabs。
代理要求:在 extension:status 确认 Chrome 已加载扩展后,暂停并要求用户执行此附加步骤,然后在继续之前等待确认。
如果您的 .agents 技能文件夹在 git fetch 或 pull 后丢失了 extension/,请从仓库修复:
cd ~/.agents/skills/agent-browser-relay 2>/dev/null || cd ~/.agents/skills/private/agent-browser-relay
git sparse-checkout disable
git config --unset-all core.sparseCheckout || true
git config --unset-all core.sparseCheckoutCone || true
git checkout -- .
5. 检查准备状态和附加状态
npm run relay:doctor -- --port "18793" --tab-id "<TAB_ID>" --json
首先从状态中解析 <TAB_ID> (npm run relay:status -- --all --status-timeout-ms 3000)。对于所有代理运行,请使用分配的标签页 ID:
npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json
仅当此命令返回成功时才继续。
18793)。/status 和 node scripts/read-active-tab.js)。agent-browser 或临时 Chrome 控制脚本)。--tab-id 租用的显式附加的目标标签页进行操作。npm run extension:path 加载主扩展路径。在 skills add 之后,这通常是 ~/.agents/skills/agent-browser-relay/extension。npm run extension:pathnpm run extension:statusnpm run relay:startnpm run relay:statusnpm run relay:doctornpm run relay:stopnode scripts/read-active-tab.jsnpm run relay:status -- --status-timeout-ms 3000curl --max-time 3 -sS "http://127.0.0.1:18793/status"npm run relay:status -- --all --status-timeout-ms 3000relay:start 之后,暂停并要求用户打开弹出窗口一次,以便 npm run extension:status -- --wait-for-connected --connected-timeout-ms 120000 可以确认 Chrome 确实已加载扩展。extension:status 成功后,才要求用户在读取前附加目标标签页,或者在首次标签页创建工作流程之前确认已启用 Allow agent to create new background tabs。npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json,并且仅在其成功时继续。Target.createTarget 打开标签页,请运行 npm run relay:doctor -- --host "127.0.0.1" --port "18793" --require-target-create --json,并且仅在其成功时继续。--tab-id <tabId>,以便每个操作都在租用范围内。Target.createTarget 时,扩展可能会为会话创建并自动附加第一个代理控制的标签页,而无需用户种子附加步骤。tabId 在中继状态 attachedTabs 中缺失,请停止并要求用户在继续之前在弹出窗口中重新附加目标标签页。relay:start 超时,请报告实际的中继日志/错误。除非命令输出显示具体的权限错误,否则不要猜测沙箱限制。读取结构化的标签页有效载荷
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>"
可选的一键冒烟测试
./scripts/preflight.sh
如果当前工作目录不是已安装的技能根目录,请使用 npm run extension:path 打印的绝对 Stable read CLI path,而不是相对的 node scripts/read-active-tab.js 路径。
read-active-tab.js 在每个成功的有效载荷中返回功能元数据,位于:
source.capabilities
版本兼容性检查也包含在 source.extension 下:
installedVersionsourceVersionrelayVersionobservedExtensionVersionversionMismatch如果检测到不匹配,该命令还会在每次运行时向 stderr 打印一条用户友好的更新提示。
scripts/read-active-tab.js 默认提取:url、title、text、links、metaDescription。--tab-id) 用于在一个中继端口上实现每个标签页的并发代理隔离。--expression 的 Runtime.evaluate 表达式模式。--screenshot 进行截图捕获模式(可选 --screenshot-full-page、--screenshot-path)。--check --wait-for-attach 进行附加状态轮询。--preset 值:default、whatsapp、wa、whatsapp-messages、chat-audit、chat。--text-regex、--exclude-text-regex、--link-text-regex、--link-href-regex。--message-regex、--exclude-message-regex、--sender-regex、--exclude-sender-regex。在代理工作流程中,使用 --tab-id 变体。无作用域的命令仅用于手动/本地调试。
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --check --wait-for-attach --require-target-create --attach-timeout-ms 120000
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --expression "document.documentElement.outerHTML"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --screenshot --screenshot-full-page --screenshot-path "./tmp/page.png"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --preset whatsapp-messages --max-messages 200 --selector "#main"
node scripts/read-active-tab.js --preset chat-audit --selector "body" --message-regex ".*"
所有成功的命令都会返回一个 source 对象,其中包含 relayHost、relayPort、relayStatusUrl 和 relayWebSocketUrl。
在自动化流程中获取数据之前,运行一次轻量级预检以确保中继 + 附加标签页状态已就绪。
对于在一个中继上的多个代理:
npm run relay:status -- --all --status-timeout-ms 3000)。read-active-tab.js 调用中使用 --tab-id。每周安装次数
77
仓库
GitHub 星标数
1
首次出现
2026年3月1日
安全审计
安装于
opencode75
gemini-cli75
codex75
kimi-cli75
amp75
cline75
Use this skill to attach to a chosen Chrome tab through the bundled Agent Browser Relay extension and extract tab metadata or DOM data for analysis.
Fresh-machine rule:
skills add guarantees the installed skill at ~/.agents/skills/agent-browser-relayskills add is ~/.agents/skills/agent-browser-relay/extension~/agent-browser-relay/extension is only an optional visible convenience copy created by npm run extension:installnpm run extension:path, npm run relay:start, and npm run relay:global:install print the primary folder to loadnpm run extension:path also prints stable absolute paths for read-active-tab.js and preflight.sh so agents can avoid cwd-dependent invocationnpm run extension:status confirm that Chrome actually loaded itchrome://extensions before attach/read steps. Do not treat a missing visible convenience copy as a sandbox or socket-permission issue.Defaults are set in code:
127.0.0.118793120000 ms Override per command with --host, --port, and --attach-timeout-ms when needed.This prints the primary Chrome extension path to load in Chrome and refreshes the optional visible convenience copy when possible.
npm run relay:start -- --status-timeout-ms 3000
Or pin host/port explicitly:
npm run relay:start -- --host "127.0.0.1" --port "18793" --status-timeout-ms 3000
relay:start keeps running until you stop it or the process is restarted. If you want a bounded session, pass --auto-stop-ms explicitly:
node scripts/relay-manager.js start --auto-stop-ms 10800000
2. Load extension in Chrome
* `chrome://extensions`
* Enable developer mode
* Load unpacked from `~/.agents/skills/agent-browser-relay/extension` after `skills add`
* If the command printed the extension path, treat that printed path as the source of truth
* Run `npm run extension:path` from the installed skill directory any time you want the exact path printed again
* `~/agent-browser-relay/extension` is optional; create it with `npm run extension:install` if you want a visible shortcut
3. Confirm the extension is loaded in Chrome
Open the toolbar popup once after relay is running. The popup should show Relay connected on <port>.
Agent requirement: before any attach step on a fresh machine, ask the human to open the popup once, then confirm:
npm run extension:status -- --wait-for-connected --connected-timeout-ms 120000
4. Attach the extension to the target tab (open toolbar popup and click attach)
Optional per-tab relay: in the popup, set Tab port before clicking attach if this tab should use a non-default relay port. If you want the agent to create its own first background tab instead, enable Allow agent to create new background tabs in the popup.
Agent requirement: after extension:status confirms Chrome loaded the extension, pause and ask the human to do this attach step, then wait for confirmation before continuing.
If your .agents skill folder drops extension/ after a git fetch or pull, repair it from the repo:
cd ~/.agents/skills/agent-browser-relay 2>/dev/null || cd ~/.agents/skills/private/agent-browser-relay
git sparse-checkout disable
git config --unset-all core.sparseCheckout || true
git config --unset-all core.sparseCheckoutCone || true
git checkout -- .
5. Check readiness and attach state
npm run relay:doctor -- --port "18793" --tab-id "<TAB_ID>" --json
Resolve <TAB_ID> from status first (npm run relay:status -- --all --status-timeout-ms 3000). For all agent runs, use the assigned tab id:
npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json
Continue only if this command returns success.
18793)./status and node scripts/read-active-tab.js).agent-browser, or ad-hoc Chrome control scripts).--tab-id.npm run extension:path before any attach/read attempt. After skills add, that is normally ~/.agents/skills/agent-browser-relay/extension.npm run extension:pathRead structured tab payload
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>"
Optional one-command smoke test
./scripts/preflight.sh
If the current working directory is not the installed skill root, use the absolute Stable read CLI path printed by npm run extension:path instead of a relative node scripts/read-active-tab.js path.
read-active-tab.js returns capability metadata in every successful payload under:
source.capabilities
Version compatibility checks are also included under source.extension:
installedVersionsourceVersionrelayVersionobservedExtensionVersionversionMismatchIf a mismatch is detected, the command also prints a human-friendly update hint to stderr on every run.
scripts/read-active-tab.js default extraction: url, title, text, links, metaDescription.--tab-id) for concurrent agent isolation per tab on one relay port.Runtime.evaluate expression mode with --expression.--screenshot (optional --screenshot-full-page, ).--preset values: default, whatsapp, wa, whatsapp-messages, chat-audit, chat.--text-regex, --exclude-text-regex, --link-text-regex, --link-href-regex.In agent workflows, use the --tab-id variants. Unscoped commands are for manual/local debugging only.
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --pretty false
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --tab-id 123 --check --wait-for-attach --require-target-create --attach-timeout-ms 120000
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --expression "document.documentElement.outerHTML"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --screenshot --screenshot-full-page --screenshot-path "./tmp/page.png"
node scripts/read-active-tab.js --host "127.0.0.1" --port "18793" --preset whatsapp-messages --max-messages 200 --selector "#main"
node scripts/read-active-tab.js --preset chat-audit --selector "body" --message-regex ".*"
All successful commands return a source object with relayHost, relayPort, relayStatusUrl, and relayWebSocketUrl.
Before fetching data in an automation flow, run a lightweight preflight once to ensure relay + attached tab state are ready.
For multiple agents on one relay:
npm run relay:status -- --all --status-timeout-ms 3000).--tab-id in every read-active-tab.js call for that agent.Weekly Installs
77
Repository
GitHub Stars
1
First Seen
Mar 1, 2026
Security Audits
Gen Agent Trust HubWarnSocketFailSnykWarn
Installed on
opencode75
gemini-cli75
codex75
kimi-cli75
amp75
cline75
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
65,000 周安装
Groove Git日志自动化工具 - 自动生成每日Git提交摘要和变更记录
119 周安装
自媒体自动发布工具 - 支持百家号、知乎、公众号等平台一键发布,提升内容分发效率
105 周安装
Outlook自动化指南:通过Rube MCP与Composio工具包实现邮件、日历、联系人管理
83 周安装
WhoDB数据库助手:简化数据库操作,支持SQL查询、模式探索与数据导出
93 周安装
Xcode MCP 设置指南:连接 Claude、Cursor、VS Code 等 AI 助手到 Xcode 开发环境
101 周安装
Kotlin Multiplatform AGP 9.0 迁移指南:解决插件兼容性与项目重构
71 周安装
npm run extension:statusnpm run relay:startnpm run relay:statusnpm run relay:doctornpm run relay:stopnode scripts/read-active-tab.jsnpm run relay:status -- --status-timeout-ms 3000curl --max-time 3 -sS "http://127.0.0.1:18793/status"npm run relay:status -- --all --status-timeout-ms 3000relay:start, pause and ask the human to open the popup once so npm run extension:status -- --wait-for-connected --connected-timeout-ms 120000 can confirm Chrome actually loaded the extension.extension:status succeeds, either ask the human to attach the target tab before reads, or confirm that Allow agent to create new background tabs is enabled before first-tab creation workflows.npm run relay:doctor -- --host "127.0.0.1" --port "18793" --tab-id "<TAB_ID>" --json before reads and proceed only when it succeeds.Target.createTarget, run npm run relay:doctor -- --host "127.0.0.1" --port "18793" --require-target-create --json and proceed only when it succeeds.--tab-id <tabId> on check/read commands so every operation is lease-scoped.Target.createTarget is enabled, the extension may create and auto-attach the first agent-controlled tab for the session without a human seed attach step.tabId is missing from relay status attachedTabs, stop and ask the human to re-attach the target tab in the popup before continuing.relay:start times out, report the actual relay log/error. Do not guess about sandbox restrictions unless the command output shows a concrete permission error.--screenshot-path--check --wait-for-attach.--message-regex, --exclude-message-regex, --sender-regex, --exclude-sender-regex.