首页/ AI 技能 / @skilllib/skill-2014279418171043841
Skill站外收录 @skilllib/skill-2014279418171043841

browser

提供网页浏览、页面导航、JavaScript 执行、截图捕获和交互式 DOM 元素选取能力,支持基于真实用户会话的自动化操作与数据提取,适用于网站探索、内容抓取及可视化验证等场景。

0.0 (0) 133 次安装 原作者 编程导航
收录于 2026-01-22
效率工具 AI 技能

Skills.MD

# Browser Tools Minimal CDP tools for collaborative site exploration and scraping. **Credits**: Based on [Mario Zechner](https://mariozechner.at)'s article [What if you don't need MCP?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/), adapted from [Factory.ai](https://docs.factory.ai/guides/skills/browser). ## Setup Before first use, install dependencies: ```bash npm install --prefix skills/browser ``` ## Start Chrome ```bash ./skills/browser/scripts/start.js # Fresh profile ./skills/browser/scripts/start.js --profile # Copy your profile (cookies, logins) ``` Start Chrome on `:9222` with remote debugging. ## Navigate ```bash ./skills/browser/scripts/nav.js https://example.com ./skills/browser/scripts/nav.js https://example.com --new ``` Navigate current tab or open new tab. ## Evaluate JavaScript ```bash ./skills/browser/scripts/eval.js 'document.title' ./skills/browser/scripts/eval.js 'document.querySelectorAll("a").length' ``` Execute JavaScript in active tab (async context). **IMPORTANT**: The code must be a single expression or use IIFE for multiple statements: - Single expression: `'document.title'` - Multiple statements: `'(() => { const x = 1; return x + 1; })()'` - Avoid newlines in the code string - keep it on one line ## Screenshot ```bash ./skills/browser/scripts/screenshot.js ``` Screenshot current viewport, returns temp file path. ## Pick Elements ```bash ./skills/browser/scripts/pick.js "Click the submit button" ``` Interactive element picker. Click to select, Cmd/Ctrl+Click for multi-select, Enter to finish. ## Workflow 1. **Start Chrome** with `start.js --profile` to mirror your authenticated state. 2. **Drive navigation** via `nav.js https://target.app` or open secondary tabs with `--new`. 3. **Inspect the DOM** using `eval.js` for quick counts, attribute checks, or extracting JSON payloads. 4. **Capture artifacts** with `screenshot.js` for visual proof or `pick.js` when you need precise selectors or text snapshots. ## Usage Notes - Start Chrome first before using other tools - The `--profile` flag syncs your actual Chrome profile so you're logged in everywhere - JavaScript evaluation runs in an async context in the page - Pick tool allows you to visually select DOM elements by clicking on them

评论 0

还没有评论,来抢沙发。