Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

chrome-browser铬浏览器

Agent Skill

chrome-browser 用于处理浏览器自动化、网页检查和页面信息提取,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,938

周安装

295

GitHub Stars

25

下载量

2,431
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:chrome-browser(铬浏览器)
来源仓库:https://github.com/oimiragieo/agent-studio
仓库路径:skills/chrome-browser
安装命令:
npx skills add https://github.com/oimiragieo/agent-studio --skill chrome-browser
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oimiragieo/agent-studio --skill chrome-browser

简介

基于 Node.js 调用 Chrome DevTools Protocol 实现浏览器控制。

  • 支持页面导航、元素操作与日志监控,适用于前端调试。
  • 需确保 Chrome 开启远程调试端口(默认 9222)。
  • 涉及外部进程通信,建议隔离测试环境避免冲突。
  • chrome-browser 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Chrome Browser Automation

Installation

Standalone script: No download; the skill invokes .claude/tools/chrome-browser/chrome-browser.cjs (Node.js v18+ required).

MCP integrations (for full automation):

  • Chrome DevTools MCP: Usually bundled with the environment; ensure Chrome/Chromium is installed (google.com/chrome).
  • Claude-in-Chrome: Install the Claude-in-Chrome extension and run with --chrome when needed.

Cheat Sheet & Best Practices

Testing: Test user-visible behavior, not implementation. Isolate tests (own storage/cookies); use before/after hooks for login or setup. Mock third-party networks instead of depending on live services.

DevTools Recorder: Record flows in Recorder panel; export as JSON or test scripts (Puppeteer, Nightwatch). Replay with Puppeteer Replay in CI. Use for performance measurement of user flows.

Hacks: Prefer Chrome DevTools MCP for testing/debugging (always on); use Claude-in-Chrome for authenticated sessions (GIF, forms). Limit GIF frames (e.g. 100) to avoid memory issues. Use take_snapshot for structure; evaluate_script for custom checks.

Certifications & Training

No official cert. Chrome for Developers – DevTools. Frontend Masters / Udemy “Mastering Chrome DevTools.” Skill data: Test user-visible behavior; isolate tests; Recorder + Puppeteer Replay; performance tracing.

Hooks & Workflows

Suggested hooks: Optional: post-test hook to capture screenshots on failure. Use when qa or frontend-pro is routed for browser testing (add chrome-browser to contextual: browser_testing or similar).

Workflows: Use with qa (add to contextual) or frontend-pro for E2E/browser flows. Flow: open URL → interact (click/fill) → snapshot or assert. See .claude/workflows/chrome-browser-skill-workflow.md.

Two Integrations - When to Use Each

FeatureChrome DevTools MCPClaude-in-Chrome
Status✅ Always available⚠️ Requires --chrome flag
ActivationAutomatic (built-in)claude --chrome + extension
Auth sessions❌ Fresh browser✅ Uses your logins
Performance tracing✅ Full Core Web Vitals❌ Not available
Network inspection✅ Detailed with body access✅ Basic
Device emulation✅ Mobile, geolocation, CPU❌ Limited
GIF recording❌ No✅ Yes (100 frame limit)
Page text extractionVia snapshot✅ Dedicated tool
Best forTesting, debugging, performanceAuthenticated workflows, demos

Performance Limits (Memory Safeguard)

Chrome browser automation can record GIF videos. To prevent memory exhaustion:

  • GIF frame limit: 100 frames (HARD LIMIT)
  • Each frame: 5-20 KB (depends on complexity)
  • 100 frames × 10 KB avg = ~1 MB per recording
  • Keeps browser session memory-efficient

Frame tracking:

  • Typical actions per frame: 1-2 (click, scroll, type)
  • 50 frames = 25-50 actions
  • 100 frames = 50-100 actions
  • For longer workflows, use multiple recordings

Decision Guide

Need to test/debug a public site?     → Chrome DevTools MCP
Need performance analysis?            → Chrome DevTools MCP
Need to access authenticated apps?    → Claude-in-Chrome (--chrome)
Need to record a demo GIF?            → Claude-in-Chrome (--chrome)
Need to interact with Google Docs?    → Claude-in-Chrome (--chrome)
Need device/network emulation?        → Chrome DevTools MCP

Claude-in-Chrome:

  • Authenticated web app interaction (Google Docs, Gmail, Notion)
  • Session recording as GIF
  • Natural language element finding
  • Form automation with your saved data
  • Page text extraction
  • Shortcut/workflow execution

Chrome DevTools MCP (Always Available)

No setup required - these tools work immediately.

Step 1: List and Select Pages

// List all open pages
mcp__chrome - devtools__list_pages();

// Select a page to work with
mcp__chrome - devtools__select_page({ pageId: 1 });

// Create a new page
mcp__chrome - devtools__new_page({ url: 'https://example.com' });

Step 2: Navigate and Interact

// Navigate to URL
mcp__chrome - devtools__navigate_page({ url: 'https://example.com' });

// Take accessibility snapshot (get element UIDs)
mcp__chrome - devtools__take_snapshot();

// Click element by UID from snapshot
mcp__chrome - devtools__click({ uid: 'ref_123' });

// Fill form field
mcp__chrome - devtools__fill({ uid: 'ref_456', value: 'test@example.com' });

// Fill entire form
mcp__chrome -
  devtools__fill_form({
    elements: [
      { uid: 'ref_456', value: 'test@example.com' },
      { uid: 'ref_789', value: 'password123' },
    ],
  });

Step 3: Debug and Inspect

// Read console messages
mcp__chrome - devtools__list_console_messages({ types: ['error', 'warn'] });

// Get specific console message details
mcp__chrome - devtools__get_console_message({ msgid: 1 });

// List network requests
mcp__chrome - devtools__list_network_requests({ resourceTypes: ['xhr', 'fetch'] });

// Get request/response details
mcp__chrome - devtools__get_network_request({ reqid: 1 });

// Execute JavaScript
mcp__chrome -
  devtools__evaluate_script({
    function: '() => document.title',
  });

Step 4: Performance Analysis

// Start performance trace (with page reload)
mcp__chrome - devtools__performance_start_trace({ reload: true, autoStop: true });

// Or manual stop
mcp__chrome - devtools__performance_start_trace({ reload: true, autoStop: false });
// ... interact with page ...
mcp__chrome - devtools__performance_stop_trace();

// Analyze specific insight
mcp__chrome -
  devtools__performance_analyze_insight({
    insightSetId: 'navigation-1',
    insightName: 'LCPBreakdown',
  });

Step 5: Device Emulation

// Emulate mobile device
mcp__chrome -
  devtools__emulate({
    viewport: {
      width: 375,
      height: 667,
      deviceScaleFactor: 2,
      isMobile: true,
      hasTouch: true,
    },
    userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X)...',
  });

// Emulate slow network
mcp__chrome - devtools__emulate({ networkConditions: 'Slow 3G' });

// Emulate geolocation
mcp__chrome -
  devtools__emulate({
    geolocation: { latitude: 37.7749, longitude: -122.4194 },
  });

Claude-in-Chrome (Requires Setup)

Prerequisites

  1. Install Claude-in-Chrome extension (v1.0.36+) from Chrome Web Store
  2. Start Claude with flag: claude --chrome
  3. Chrome must be visible (no headless mode)
  4. Paid Claude plan required (Pro, Team, or Enterprise)

Step 1: Get Tab Context

// ALWAYS call first to get available tabs
mcp__claude-in-chrome__tabs_context_mcp({ createIfEmpty: true })

// Create a new tab for this conversation
mcp__claude-in-chrome__tabs_create_mcp()

Step 2: Navigate and Read

// Navigate to URL
mcp__claude-in-chrome__navigate({ url: "https://docs.google.com", tabId: 123 })

// Read page structure (accessibility tree)
mcp__claude-in-chrome__read_page({ tabId: 123 })

// Find elements by natural language
mcp__claude-in-chrome__find({ query: "login button", tabId: 123 })

// Extract page text
mcp__claude-in-chrome__get_page_text({ tabId: 123 })

Step 3: Interact

// Click, type, screenshot via computer tool
mcp__claude-in-chrome__computer({
  action: "left_click",
  coordinate: [100, 200],
  tabId: 123
})

mcp__claude-in-chrome__computer({
  action: "type",
  text: "Hello world",
  tabId: 123
})

mcp__claude-in-chrome__computer({
  action: "screenshot",
  tabId: 123
})

// Fill form by element reference
mcp__claude-in-chrome__form_input({
  ref: "ref_1",
  value: "test@example.com",
  tabId: 123
})

Step 4: Record GIF Demo

// Start recording
mcp__claude-in-chrome__gif_creator({ action: "start_recording", tabId: 123 })

// Take screenshot to capture initial state
mcp__claude-in-chrome__computer({ action: "screenshot", tabId: 123 })

// ... perform actions ...

// Take final screenshot
mcp__claude-in-chrome__computer({ action: "screenshot", tabId: 123 })

// Stop and export
mcp__claude-in-chrome__gif_creator({ action: "stop_recording", tabId: 123 })
mcp__claude-in-chrome__gif_creator({
  action: "export",
  download: true,
  filename: "demo.gif",
  tabId: 123
})

Recording Best Practices

✓ GOOD patterns:

  • Login flow: 15-20 frames (5-10 actions)
  • Form filling: 10-15 frames (5-8 actions)
  • Navigation demo: 20-30 frames (10-15 actions)
  • Full workflow: 2-3 recordings of 30-50 frames each

✗ BAD patterns:

  • Single recording with 200+ frames
  • Waiting for loading (adds 10+ empty frames per second)
  • Continuous scrolling (can reach 100+ frames quickly)
  • Multiple simultaneous recordings

If you hit 100 frames:

  1. Stop recording
  2. Export current GIF
  3. Start new recording for next part
  4. Link recordings together in documentation

Timeout Management

  • Default timeout: 30 seconds per recording
  • If recording >100 frames: Use multiple 30-second recordings
  • Don't wait for slow loading (screenshot instead)
  • Keep actions fast (minimize waits)

</execution_process>

<best_practices>

Chrome DevTools MCP

  1. Always take snapshot first to get element UIDs before clicking/filling
  2. Use includeSnapshot: true on actions to get updated state
  3. Filter network requests by resourceTypes to avoid noise
  4. Save traces to file with filePath parameter for later analysis

Claude-in-Chrome

  1. Call tabs_context_mcp first to get valid tab IDs
  2. Create new tabs rather than reusing existing ones
  3. Use read_page before find to understand page structure
  4. Filter console with patterns to avoid verbosity
  5. Dismiss modal dialogs manually - they block all events

General

  1. Prefer Chrome DevTools MCP for public sites (always available)
  2. Use Claude-in-Chrome only when authentication is required
  3. Don't trigger alert/confirm/prompt - they block browser events

</best_practices>

// Create page and navigate
mcp__chrome - devtools__new_page({ url: 'https://example.com/login' });

// Take snapshot to get element UIDs
mcp__chrome - devtools__take_snapshot();

// Fill login form
mcp__chrome -
  devtools__fill_form({
    elements: [
      { uid: 'email_field', value: 'test@example.com' },
      { uid: 'password_field', value: 'testpass123' },
    ],
  });

// Click submit
mcp__chrome - devtools__click({ uid: 'submit_button' });

// Check for errors
mcp__chrome - devtools__list_console_messages({ types: ['error'] });

</usage_example>

<usage_example> Performance Audit (Chrome DevTools MCP):

// Navigate to page
mcp__chrome - devtools__navigate_page({ url: 'https://example.com' });

// Run performance trace with reload
mcp__chrome -
  devtools__performance_start_trace({
    reload: true,
    autoStop: true,
    filePath: 'trace.json.gz',
  });

// Analyze LCP breakdown
mcp__chrome -
  devtools__performance_analyze_insight({
    insightSetId: 'navigation-1',
    insightName: 'LCPBreakdown',
  });

</usage_example>

<usage_example> Google Docs Editing (Claude-in-Chrome):

// Get tab context
mcp__claude-in-chrome__tabs_context_mcp({ createIfEmpty: true })

// Navigate to Google Docs (uses your login)
mcp__claude-in-chrome__navigate({
  url: "https://docs.google.com/document/d/YOUR_DOC_ID",
  tabId: 123
})

// Read page to find elements
mcp__claude-in-chrome__read_page({ tabId: 123 })

// Click in document and type
mcp__claude-in-chrome__computer({
  action: "left_click",
  ref: "document_body",
  tabId: 123
})

mcp__claude-in-chrome__computer({
  action: "type",
  text: "Meeting notes for today...",
  tabId: 123
})

</usage_example>

<usage_example> Record Demo GIF (Claude-in-Chrome):

// Start recording
mcp__claude-in-chrome__gif_creator({ action: "start_recording", tabId: 123 })

// Initial screenshot
mcp__claude-in-chrome__computer({ action: "screenshot", tabId: 123 })

// Navigate
mcp__claude-in-chrome__navigate({ url: "https://example.com/product", tabId: 123 })
mcp__claude-in-chrome__computer({ action: "screenshot", tabId: 123 })

// Click add to cart
mcp__claude-in-chrome__computer({ action: "left_click", ref: "add_to_cart", tabId: 123 })
mcp__claude-in-chrome__computer({ action: "screenshot", tabId: 123 })

// Stop and export
mcp__claude-in-chrome__gif_creator({ action: "stop_recording", tabId: 123 })
mcp__claude-in-chrome__gif_creator({
  action: "export",
  download: true,
  filename: "add-to-cart-flow.gif",
  options: { showClickIndicators: true, showProgressBar: true },
  tabId: 123
})

</usage_example>

Available Tools

Chrome DevTools MCP (Always Available)

ToolDescription
mcp__chrome-devtools__list_pagesList all browser pages
mcp__chrome-devtools__select_pageSelect page for operations
mcp__chrome-devtools__new_pageCreate new page with URL
mcp__chrome-devtools__close_pageClose a page
mcp__chrome-devtools__navigate_pageNavigate, reload, back/forward
mcp__chrome-devtools__take_snapshotGet accessibility tree with UIDs
mcp__chrome-devtools__take_screenshotCapture page/element screenshot
mcp__chrome-devtools__clickClick element by UID
mcp__chrome-devtools__fillFill input/select by UID
mcp__chrome-devtools__fill_formFill multiple form elements
mcp__chrome-devtools__hoverHover over element
mcp__chrome-devtools__dragDrag element to another
mcp__chrome-devtools__press_keyPress key or combination
mcp__chrome-devtools__evaluate_scriptExecute JavaScript
mcp__chrome-devtools__handle_dialogAccept/dismiss dialogs
mcp__chrome-devtools__upload_fileUpload file via input
mcp__chrome-devtools__wait_forWait for text to appear
mcp__chrome-devtools__resize_pageResize browser window
mcp__chrome-devtools__emulateDevice/network/geo emulation
mcp__chrome-devtools__list_console_messagesList console output
mcp__chrome-devtools__get_console_messageGet message details
mcp__chrome-devtools__list_network_requestsList network requests
mcp__chrome-devtools__get_network_requestGet request/response details
mcp__chrome-devtools__performance_start_traceStart performance recording
mcp__chrome-devtools__performance_stop_traceStop performance recording
mcp__chrome-devtools__performance_analyze_insightAnalyze performance insight

Claude-in-Chrome (Requires --chrome flag)

ToolDescription
mcp__claude-in-chrome__tabs_context_mcpGet tab context (call first!)
mcp__claude-in-chrome__tabs_create_mcpCreate new tab
mcp__claude-in-chrome__navigateNavigate to URL
mcp__claude-in-chrome__read_pageGet accessibility tree
mcp__claude-in-chrome__findFind elements by description
mcp__claude-in-chrome__get_page_textExtract page text
mcp__claude-in-chrome__computerClick, type, screenshot, scroll
mcp__claude-in-chrome__form_inputFill form field
mcp__claude-in-chrome__fill_formFill multiple fields
mcp__claude-in-chrome__javascript_toolExecute JavaScript
mcp__claude-in-chrome__read_console_messagesRead console logs
mcp__claude-in-chrome__read_network_requestsRead network requests
mcp__claude-in-chrome__resize_windowResize browser window
mcp__claude-in-chrome__upload_imageUpload image to element
mcp__claude-in-chrome__gif_creatorRecord/export GIF
mcp__claude-in-chrome__shortcuts_listList available shortcuts
mcp__claude-in-chrome__shortcuts_executeExecute shortcut
mcp__claude-in-chrome__update_planPresent plan for approval

Agent Integration

This skill is automatically assigned to:

  • developer - Testing, debugging, data extraction
  • qa - Automated testing, form validation, user flow verification
  • security-architect - Security testing, authentication flows
  • devops-troubleshooter - Production debugging, monitoring
  • researcher - Web scraping, data extraction

Related Workflow

For guidance on using this skill effectively, see the corresponding workflow:

  • Workflow File: .claude/workflows/chrome-browser-skill-workflow.md
  • When to Use: When you need browser automation for testing, debugging, authenticated workflows, or demo recording
  • Integration Methods:

- Slash command invocation (/chrome-browser) - Agent skill assignment (via frontmatter) - Direct script execution

Two Integration Options:

  • Chrome DevTools MCP (always available) - For public site testing, performance analysis, debugging
  • Claude-in-Chrome (requires --chrome flag) - For authenticated app workflows, GIF recording

The workflow provides examples for invocation methods, agent assignment, and memory integration patterns.

Troubleshooting

Claude-in-Chrome "Browser extension is not connected"

Symptom: When using --chrome flag, tools return "Browser extension is not connected" error despite extension being installed.

Root Cause: Claude.app (desktop) and Claude Code register competing native messaging hosts. When both are installed, the Chrome extension connects to whichever registered last, causing connection failures.

Diagnosis:

  1. Check if both Claude.app and Claude Code are installed
  2. On Windows: Check %APPDATA%\Claude\ChromeNativeHost\com.anthropic.claude_browser_extension.json
  3. On macOS: Check ~/Library/Application Support/Claude/ChromeNativeHost/

Known Bug: This is documented in GitHub issues:

  • #15336 - Windows Native Messaging Host not installing
  • #14894 - Reconnect extension fails on macOS
  • #20790 - Extension connects to Claude.app instead of Claude Code

Workaround (macOS):

# Disable Claude.app's native host (keep file for restoration)
cd ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/
mv com.anthropic.claude_browser_extension.json com.anthropic.claude_browser_extension.json.disabled

# Restart Chrome completely (quit and reopen)
# Then start Claude Code with --chrome flag

Workaround (Windows): Not fully documented. Potential approach:

# Rename the config to disable Claude.app's registration
cd $env:APPDATA\Claude\ChromeNativeHost
ren com.anthropic.claude_browser_extension.json com.anthropic.claude_browser_extension.json.disabled

# Restart Chrome and try again

Alternative: Use Chrome DevTools MCP instead - it works without the extension and provides similar functionality for most use cases.

Modal Dialogs Blocking Events

Symptom: After triggering alert/confirm/prompt, all browser tools stop responding.

Cause: JavaScript modal dialogs block all browser events including extension communication.

Fix: User must manually dismiss the dialog in the browser. Avoid triggering dialogs in automation scripts.

Memory Protocol (MANDATORY)

Before starting:

cat .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.29%
按下载量换算882

Claude

28.14%
按下载量换算684

Cursor

18.16%
按下载量换算441

Gemini CLI

9.76%
按下载量换算237

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills