重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
browser-tools by badlogic/pi-skills
npx skills add https://github.com/badlogic/pi-skills --skill browser-tools用于代理辅助网页自动化的 Chrome DevTools Protocol 工具。这些工具连接到运行在 :9222 端口且启用了远程调试功能的 Chrome 浏览器。
首次使用前运行一次:
cd {baseDir}/browser-tools
npm install
{baseDir}/browser-start.js # 全新配置文件
{baseDir}/browser-start.js --profile # 复制用户的配置文件(cookies、登录状态)
在 :9222 端口启动 Chrome 并启用远程调试。使用 --profile 参数以保留用户的认证状态。
{baseDir}/browser-nav.js https://example.com
{baseDir}/browser-nav.js https://example.com --new
导航到指定 URL。使用 --new 标志在新标签页中打开,而不是复用当前标签页。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
{baseDir}/browser-eval.js 'document.title'
{baseDir}/browser-eval.js 'document.querySelectorAll("a").length'
在当前活动标签页中执行 JavaScript 代码。代码在异步上下文中运行。使用此功能来提取数据、检查页面状态或以编程方式执行 DOM 操作。
{baseDir}/browser-screenshot.js
捕获当前视口并返回临时文件路径。使用此功能来可视化检查页面状态或验证 UI 更改。
{baseDir}/browser-pick.js "点击提交按钮"
重要提示:当用户需要选择页面上的特定 DOM 元素时,请使用此工具。它会启动一个交互式选取器,让用户通过点击来选择元素。用户可以选择多个元素(Cmd/Ctrl+点击),完成后按 Enter 键。该工具会返回所选元素的 CSS 选择器。
常见使用场景:
{baseDir}/browser-cookies.js
显示当前标签页的所有 cookies,包括域名、路径、httpOnly 和 secure 标志。使用此功能来调试认证问题或检查会话状态。
{baseDir}/browser-content.js https://example.com
导航到 URL 并将可读内容提取为 markdown 格式。使用 Mozilla Readability 进行文章提取,使用 Turndown 进行 HTML 到 markdown 的转换。适用于包含 JavaScript 内容的页面(等待页面加载完成)。
不要通过截图来查看页面状态。应该直接解析 DOM:
// 获取页面结构
document.body.innerHTML.slice(0, 5000)
// 查找交互元素
Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({
id: e.id,
text: e.textContent.trim(),
class: e.className
}))
将所有内容包装在 IIFE 中以运行多语句代码:
(function() {
// 多个操作
const data = document.querySelector('#target').textContent;
const buttons = document.querySelectorAll('button');
// 交互
buttons[0].click();
// 返回结果
return JSON.stringify({ data, buttonCount: buttons.length });
})()
不要为每次点击进行单独调用。应该批量处理:
(function() {
const actions = ["btn1", "btn2", "btn3"];
actions.forEach(id => document.getElementById(id).click());
return "Done";
})()
(function() {
const text = "HELLO";
for (const char of text) {
document.getElementById("key-" + char).click();
}
document.getElementById("submit").click();
return "Submitted: " + text;
})()
在一次调用中提取结构化状态:
(function() {
const state = {
score: document.querySelector('.score')?.textContent,
status: document.querySelector('.status')?.className,
items: Array.from(document.querySelectorAll('.item')).map(el => ({
text: el.textContent,
active: el.classList.contains('active')
}))
};
return JSON.stringify(state, null, 2);
})()
如果 DOM 在操作后更新,使用 bash 添加短暂延迟:
sleep 0.5 && {baseDir}/browser-eval.js '...'
始终从理解页面结构开始:
(function() {
return {
title: document.title,
forms: document.forms.length,
buttons: document.querySelectorAll('button').length,
inputs: document.querySelectorAll('input').length,
mainContent: document.body.innerHTML.slice(0, 3000)
};
})()
然后根据您的发现定位特定元素。
每周安装量
50
代码仓库
GitHub 星标数
775
首次出现
2026年1月24日
安全审计
已安装于
opencode34
codex33
gemini-cli32
claude-code28
github-copilot28
cursor28
Chrome DevTools Protocol tools for agent-assisted web automation. These tools connect to Chrome running on :9222 with remote debugging enabled.
Run once before first use:
cd {baseDir}/browser-tools
npm install
{baseDir}/browser-start.js # Fresh profile
{baseDir}/browser-start.js --profile # Copy user's profile (cookies, logins)
Launch Chrome with remote debugging on :9222. Use --profile to preserve user's authentication state.
{baseDir}/browser-nav.js https://example.com
{baseDir}/browser-nav.js https://example.com --new
Navigate to URLs. Use --new flag to open in a new tab instead of reusing current tab.
{baseDir}/browser-eval.js 'document.title'
{baseDir}/browser-eval.js 'document.querySelectorAll("a").length'
Execute JavaScript in the active tab. Code runs in async context. Use this to extract data, inspect page state, or perform DOM operations programmatically.
{baseDir}/browser-screenshot.js
Capture current viewport and return temporary file path. Use this to visually inspect page state or verify UI changes.
{baseDir}/browser-pick.js "Click the submit button"
IMPORTANT : Use this tool when the user wants to select specific DOM elements on the page. This launches an interactive picker that lets the user click elements to select them. The user can select multiple elements (Cmd/Ctrl+Click) and press Enter when done. The tool returns CSS selectors for the selected elements.
Common use cases:
{baseDir}/browser-cookies.js
Display all cookies for the current tab including domain, path, httpOnly, and secure flags. Use this to debug authentication issues or inspect session state.
{baseDir}/browser-content.js https://example.com
Navigate to a URL and extract readable content as markdown. Uses Mozilla Readability for article extraction and Turndown for HTML-to-markdown conversion. Works on pages with JavaScript content (waits for page to load).
Don't take screenshots to see page state. Do parse the DOM directly:
// Get page structure
document.body.innerHTML.slice(0, 5000)
// Find interactive elements
Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({
id: e.id,
text: e.textContent.trim(),
class: e.className
}))
Wrap everything in an IIFE to run multi-statement code:
(function() {
// Multiple operations
const data = document.querySelector('#target').textContent;
const buttons = document.querySelectorAll('button');
// Interactions
buttons[0].click();
// Return results
return JSON.stringify({ data, buttonCount: buttons.length });
})()
Don't make separate calls for each click. Do batch them:
(function() {
const actions = ["btn1", "btn2", "btn3"];
actions.forEach(id => document.getElementById(id).click());
return "Done";
})()
(function() {
const text = "HELLO";
for (const char of text) {
document.getElementById("key-" + char).click();
}
document.getElementById("submit").click();
return "Submitted: " + text;
})()
Extract structured state in one call:
(function() {
const state = {
score: document.querySelector('.score')?.textContent,
status: document.querySelector('.status')?.className,
items: Array.from(document.querySelectorAll('.item')).map(el => ({
text: el.textContent,
active: el.classList.contains('active')
}))
};
return JSON.stringify(state, null, 2);
})()
If DOM updates after actions, add a small delay with bash:
sleep 0.5 && {baseDir}/browser-eval.js '...'
Always start by understanding the page structure:
(function() {
return {
title: document.title,
forms: document.forms.length,
buttons: document.querySelectorAll('button').length,
inputs: document.querySelectorAll('input').length,
mainContent: document.body.innerHTML.slice(0, 3000)
};
})()
Then target specific elements based on what you find.
Weekly Installs
50
Repository
GitHub Stars
775
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubFailSocketFailSnykFail
Installed on
opencode34
codex33
gemini-cli32
claude-code28
github-copilot28
cursor28
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
48,700 周安装