chrome-browser-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Chrome Browser Automation

Chrome浏览器自动化

Quick Start

快速开始

Test a local web application with console monitoring:
User: "Open localhost:3000 and check for console errors when I submit the login form"

1. Get tab context: tabs_context_mcp(createIfEmpty=true)
2. Navigate to app: navigate(url="http://localhost:3000", tabId=<id>)
3. Monitor console: read_console_messages(tabId=<id>, onlyErrors=true)
4. Fill form: form_input(ref="email", value="test@example.com", tabId=<id>)
5. Submit: computer(action="left_click", ref="submit-btn", tabId=<id>)
6. Check errors: read_console_messages(tabId=<id>, onlyErrors=true)
7. Check network: read_network_requests(tabId=<id>, urlPattern="/api/")
8. Report findings with specific error messages and failed requests
Key advantage: Chain browser actions with terminal commands in a single workflow.
测试带控制台监控的本地Web应用:
User: "Open localhost:3000 and check for console errors when I submit the login form"

1. 获取标签页上下文:tabs_context_mcp(createIfEmpty=true)
2. 导航至应用:navigate(url="http://localhost:3000", tabId=<id>)
3. 监控控制台:read_console_messages(tabId=<id>, onlyErrors=true)
4. 填写表单:form_input(ref="email", value="test@example.com", tabId=<id>)
5. 提交表单:computer(action="left_click", ref="submit-btn", tabId=<id>)
6. 检查错误:read_console_messages(tabId=<id>, onlyErrors=true)
7. 检查网络请求:read_network_requests(tabId=<id>, urlPattern="/api/")
8. 报告结果,包含具体错误信息和失败请求
核心优势: 在单个工作流中将浏览器操作与终端命令串联执行。

Table of Contents

目录

  1. When to Use This Skill
  2. What This Skill Does
  3. Setup and Prerequisites
  4. Core Workflow Patterns
    • 4.1 Testing Web Applications
    • 4.2 Debugging with Console and Network
    • 4.3 Data Extraction
    • 4.4 Form Automation
    • 4.5 Authenticated Web Apps
    • 4.6 Multi-Site Workflows
  5. MCP Tool Reference
  6. Best Practices
  7. Troubleshooting
  8. Integration with Other Skills
  1. 适用场景
  2. 功能介绍
  3. 安装与前置要求
  4. 核心工作流模式
    • 4.1 Web应用测试
    • 4.2 控制台与网络调试
    • 4.3 数据提取
    • 4.4 表单自动化
    • 4.5 已认证Web应用交互
    • 4.6 多站点工作流
  5. MCP工具参考
  6. 最佳实践
  7. 故障排查
  8. 与其他技能集成

When to Use This Skill

适用场景

Explicit Triggers:
  • "Test my web app" / "Check the console"
  • "Fill this form" / "Extract data from [URL]"
  • "Automate [browser task]" / "Open [authenticated app]"
  • "Debug [frontend issue]" / "Verify [UI behavior]"
Implicit Triggers:
  • Frontend bug investigation requiring console logs
  • Repetitive data entry or form filling
  • Web scraping or data extraction from live sites
  • Testing form validation or user flows
  • Interacting with authenticated services (Gmail, Docs, Notion)
  • Visual regression testing or design verification
Debugging Triggers:
  • "Why is this breaking in the browser?"
  • "What console errors appear when I..."
  • "What network requests are failing?"
显式触发指令:
  • "Test my web app" / "Check the console"
  • "Fill this form" / "Extract data from [URL]"
  • "Automate [browser task]" / "Open [authenticated app]"
  • "Debug [frontend issue]" / "Verify [UI behavior]"
隐式触发场景:
  • 需要控制台日志的前端Bug排查
  • 重复数据录入或表单填写
  • 网页内容抓取或数据提取
  • 表单验证或用户流程测试
  • 与已认证服务(Gmail、Docs、Notion)交互
  • 视觉回归测试或设计验证
调试触发场景:
  • "为什么这个功能在浏览器里崩溃了?"
  • "当我执行[操作]时,控制台有什么错误?"
  • "哪些网络请求失败了?"

What This Skill Does

功能介绍

Chrome integration enables six core capabilities:
  1. Live Debugging - Read console errors and DOM state, identify root cause, fix code
  2. Web App Testing - Verify form validation, check user flows, test local development servers
  3. Data Extraction - Scrape structured data from web pages and save locally
  4. Form Automation - Automate repetitive data entry, form filling, multi-site workflows
  5. Authenticated Apps - Interact with Google Docs, Gmail, Notion, or any logged-in service
  6. Session Recording - Capture browser interactions as annotated GIFs for documentation
Chrome集成支持六大核心功能:
  1. 实时调试 - 读取控制台错误和DOM状态,定位根因并修复代码
  2. Web应用测试 - 验证表单规则、检查用户流程、测试本地开发服务器
  3. 数据提取 - 从网页抓取结构化数据并保存到本地
  4. 表单自动化 - 自动化重复数据录入、表单填写和多站点工作流
  5. 已认证应用交互 - 与Google Docs、Gmail、Notion或任何已登录服务交互
  6. 会话录制 - 将浏览器交互捕获为带注释的GIF用于文档记录

Setup and Prerequisites

安装与前置要求

Required:
  • Google Chrome browser
  • Claude in Chrome extension v1.0.36+ (from Chrome Web Store)
  • Claude Code CLI v2.0.73+ (
    claude --version
    )
  • Paid Claude plan (Pro, Team, or Enterprise)
Enable Chrome integration:
bash
undefined
必备条件:
  • Google Chrome浏览器
  • Claude in Chrome扩展 v1.0.36+(从Chrome应用商店安装)
  • Claude Code CLI v2.0.73+(执行
    claude --version
    查看版本)
  • 付费Claude套餐(Pro、Team或Enterprise)
启用Chrome集成:
bash
undefined

Start with Chrome enabled

启动时启用Chrome集成

claude --chrome
claude --chrome

Or enable from within session

或在会话内启用

/chrome

**Verify connection:**

```bash
/chrome

**验证连接:**

```bash

Check status and manage settings

查看状态并管理设置

/chrome
/chrome

List available MCP tools

列出可用MCP工具

/mcp
/mcp

Click into 'claude-in-chrome' to see all tools

点击'claude-in-chrome'查看所有工具


**Enable by default (optional):**

Run `/chrome` and select "Enabled by default" to avoid `--chrome` flag each time.

**Note:** Chrome integration requires a visible browser window. You'll see Chrome open and navigate in real time - there's no headless mode.

**设置默认启用(可选):**

执行`/chrome`并选择"Enabled by default",避免每次启动都添加`--chrome`参数。

**注意:** Chrome集成需要可见的浏览器窗口。你会看到Chrome实时打开并导航,不支持无头模式。

Core Workflow Patterns

核心工作流模式

4.1 Testing Web Applications

4.1 Web应用测试

Pattern: Test local development server
Workflow:
1. tabs_context_mcp(createIfEmpty=true) → Get tabId
2. navigate(url="http://localhost:3000", tabId=<id>)
3. computer(action="screenshot", tabId=<id>) → Visual verification
4. form_input(ref="username", value="testuser", tabId=<id>)
5. computer(action="left_click", ref="submit", tabId=<id>)
6. read_console_messages(tabId=<id>, onlyErrors=true)
7. read_network_requests(tabId=<id>, urlPattern="/api/auth")
8. Report: Success/failure with specific errors or network issues
Common testing scenarios:
  • Form validation (submit invalid data, verify error messages)
  • User flows (signup → login → dashboard → action)
  • Visual regressions (screenshot before/after changes)
  • API integration (verify network requests match expectations)
Example request:
"I just updated the signup form. Can you test it on localhost:3000?
Try submitting with invalid email, then valid data, and check if
the success message appears."
模式:测试本地开发服务器
工作流:
1. tabs_context_mcp(createIfEmpty=true) → 获取tabId
2. navigate(url="http://localhost:3000", tabId=<id>) → 导航至应用
3. computer(action="screenshot", tabId=<id>) → 视觉验证
4. form_input(ref="username", value="testuser", tabId=<id>) → 填写用户名
5. computer(action="left_click", ref="submit", tabId=<id>) → 提交表单
6. read_console_messages(tabId=<id>, onlyErrors=true) → 检查控制台错误
7. read_network_requests(tabId=<id>, urlPattern="/api/auth") → 检查认证相关网络请求
8. 报告:执行结果(成功/失败)及具体错误或网络问题
常见测试场景:
  • 表单验证(提交无效数据,验证错误提示)
  • 用户流程测试(注册→登录→仪表盘→操作)
  • 视觉回归测试(变更前后截图对比)
  • API集成验证(确认网络请求符合预期)
示例请求:
"我刚更新了注册表单,能帮我在localhost:3000上测试吗?
尝试提交无效邮箱,再提交有效数据,检查是否显示成功提示。"

4.2 Debugging with Console and Network

4.2 控制台与网络调试

Pattern: Investigate frontend errors
Workflow:
1. tabs_context_mcp() → Get current tab
2. read_console_messages(
     tabId=<id>,
     pattern="error|exception|failed",
     onlyErrors=true
   )
3. read_network_requests(
     tabId=<id>,
     urlPattern="/api/",
     filterStatus=[400, 401, 403, 404, 500, 502, 503]
   )
4. Analyze errors:
   - Console: TypeError, ReferenceError, network failures
   - Network: Failed requests, 401 unauthorized, 500 server errors
5. Identify root cause (missing API endpoint, CORS issue, auth token expired)
6. Suggest fix in codebase (update API call, add error handling, fix endpoint)
Example request:
"The dashboard page is throwing errors. Can you check what's failing?"
Common debugging patterns:
  • CORS issues (network request blocked, check headers)
  • API authentication (401/403, check token in request headers)
  • Missing dependencies (module not found, check imports)
  • Runtime errors (undefined variables, null references)
See
references/debugging-patterns.md
for comprehensive error analysis workflows.
模式:排查前端错误
工作流:
1. tabs_context_mcp() → 获取当前标签页
2. read_console_messages(
     tabId=<id>,
     pattern="error|exception|failed",
     onlyErrors=true
   ) → 读取错误日志
3. read_network_requests(
     tabId=<id>,
     urlPattern="/api/",
     filterStatus=[400, 401, 403, 404, 500, 502, 503]
   ) → 读取失败的网络请求
4. 错误分析:
   - 控制台:TypeError、ReferenceError、网络失败
   - 网络:请求失败、401未授权、500服务器错误
5. 定位根因(缺失API端点、CORS问题、认证令牌过期)
6. 代码修复建议(更新API调用、添加错误处理、修复端点)
示例请求:
"仪表盘页面报错了,能帮我看看哪里出问题了吗?"
常见调试场景:
  • CORS问题(网络请求被拦截,检查请求头)
  • API认证问题(401/403错误,检查请求头中的令牌)
  • 依赖缺失(模块未找到,检查导入语句)
  • 运行时错误(变量未定义、空引用)
完整错误分析工作流请参考
references/debugging-patterns.md

4.3 Data Extraction

4.3 数据提取

Pattern: Scrape structured data from web pages
Workflow:
1. tabs_context_mcp(createIfEmpty=true)
2. navigate(url="https://example.com/products", tabId=<id>)
3. get_page_text(tabId=<id>) → Full page text
4. Parse structured data:
   - Product names
   - Prices
   - Availability
   - URLs
5. Save to CSV/JSON:
   Write(file_path="products.csv", content=<data>)
6. Report: "Extracted 47 products to products.csv"
Example request:
"Go to the product listings page and extract the name, price, and
availability for each item. Save as CSV."
Advanced extraction:
  • Multi-page pagination (loop through pages)
  • Dynamic content (wait for AJAX to load)
  • Authenticated data (use logged-in session)
See
examples/data-extraction-examples.md
for complex scraping workflows.
模式:从网页抓取结构化数据
工作流:
1. tabs_context_mcp(createIfEmpty=true) → 创建或获取标签页
2. navigate(url="https://example.com/products", tabId=<id>) → 导航至目标页面
3. get_page_text(tabId=<id>) → 获取页面完整文本
4. 解析结构化数据:
   - 产品名称
   - 价格
   - 库存状态
   - 商品链接
5. 保存为CSV/JSON:
   Write(file_path="products.csv", content=<data>)
6. 报告:"已提取47个产品数据至products.csv"
示例请求:
"前往产品列表页,提取每个商品的名称、价格和库存状态,保存为CSV文件。"
高级提取功能:
  • 多页面分页(循环遍历所有页面)
  • 动态内容提取(等待AJAX加载完成)
  • 已认证数据提取(使用已登录会话)
复杂抓取工作流请参考
examples/data-extraction-examples.md

4.4 Form Automation

4.4 表单自动化

Pattern: Automate repetitive data entry
Workflow:
1. Read local data: Read(file_path="contacts.csv")
2. Parse CSV rows
3. For each row:
   a. tabs_context_mcp()
   b. navigate(url="https://crm.example.com/add-contact", tabId=<id>)
   c. form_input(ref="name", value=row.name, tabId=<id>)
   d. form_input(ref="email", value=row.email, tabId=<id>)
   e. form_input(ref="phone", value=row.phone, tabId=<id>)
   f. computer(action="left_click", ref="submit", tabId=<id>)
   g. Wait for confirmation
4. Report: "Processed 15 contacts successfully"
Example request:
"I have customer contacts in contacts.csv. For each row, go to
our CRM and fill in the contact form."
Form filling tips:
  • Use
    form_input
    for text fields (faster than typing)
  • Use
    computer(action="left_click")
    for buttons
  • Use
    computer(action="type")
    for rich text editors
  • Wait between submissions to avoid rate limits
模式:自动化重复数据录入
工作流:
1. 读取本地数据:Read(file_path="contacts.csv")
2. 解析CSV行数据
3. 遍历每一行数据:
   a. tabs_context_mcp() → 获取当前标签页
   b. navigate(url="https://crm.example.com/add-contact", tabId=<id>) → 导航至CRM添加页面
   c. form_input(ref="name", value=row.name, tabId=<id>) → 填写姓名
   d. form_input(ref="email", value=row.email, tabId=<id>) → 填写邮箱
   e. form_input(ref="phone", value=row.phone, tabId=<id>) → 填写电话
   f. computer(action="left_click", ref="submit", tabId=<id>) → 提交表单
   g. 等待确认提示
4. 报告:"已成功处理15条联系人数据"
示例请求:
"我有一个contacts.csv的客户联系人列表,帮我逐条导入到我们的CRM系统中。"
表单填写技巧:
  • 使用
    form_input
    填充文本字段(比手动输入更快)
  • 使用
    computer(action="left_click")
    点击按钮
  • 使用
    computer(action="type")
    填充富文本编辑器
  • 提交间隔添加等待时间,避免触发频率限制

4.5 Authenticated Web Apps

4.5 已认证Web应用交互

Pattern: Interact with Google Docs, Gmail, Notion
Workflow:
1. tabs_context_mcp() → Access existing logged-in session
2. navigate(url="https://docs.google.com/document/d/abc123", tabId=<id>)
3. computer(action="left_click", coordinate=[400, 300], tabId=<id>) → Click into editor
4. computer(action="type", text="Meeting notes:\n- Discussed Q1 roadmap", tabId=<id>)
5. Verify: get_page_text(tabId=<id>) → Check content saved
6. Report: "Added meeting notes to Google Doc"
Example request:
"Draft a project update based on recent commits and add it to my
Google Doc at docs.google.com/document/d/abc123"
Supported authenticated apps:
  • Google Workspace (Docs, Sheets, Gmail, Calendar)
  • Notion (databases, pages)
  • Slack (channels, DMs)
  • GitHub (issues, PRs)
  • Any service you're logged into in Chrome
Authentication handling:
  • Uses your existing browser login state (no credential entry needed)
  • If you hit a login page, Claude pauses and asks you to log in manually
  • Claude never handles passwords or 2FA (you complete authentication)
模式:与Google Docs、Gmail、Notion交互
工作流:
1. tabs_context_mcp() → 访问已登录的会话
2. navigate(url="https://docs.google.com/document/d/abc123", tabId=<id>) → 打开Google文档
3. computer(action="left_click", coordinate=[400, 300], tabId=<id>) → 点击编辑器区域
4. computer(action="type", text="会议记录:\n- 讨论了Q1路线图", tabId=<id>) → 输入内容
5. 验证:get_page_text(tabId=<id>) → 检查内容是否保存
6. 报告:"已向Google文档添加会议记录"
示例请求:
"根据最近的提交记录起草项目更新,并添加到我的Google文档(地址:docs.google.com/document/d/abc123)中。"
支持的已认证应用:
  • Google Workspace(Docs、Sheets、Gmail、Calendar)
  • Notion(数据库、页面)
  • Slack(频道、私信)
  • GitHub(Issue、PR)
  • 任何你已在Chrome中登录的服务
认证处理说明:
  • 使用浏览器已有的登录状态(无需输入凭证)
  • 如果遇到登录页面,Claude会暂停并提示你手动登录
  • Claude不会处理密码或双因素认证(由用户完成认证流程)

4.6 Multi-Site Workflows

4.6 多站点工作流

Pattern: Coordinate tasks across multiple websites
Workflow:
1. Check calendar for meetings tomorrow
   - navigate(url="https://calendar.google.com", tabId=<id>)
   - get_page_text(tabId=<id>)
   - Extract meeting attendees
2. For each external attendee:
   - tabs_create_mcp() → New tab
   - navigate(url="https://linkedin.com/in/{name}", tabId=<new-id>)
   - get_page_text(tabId=<new-id>)
   - Extract company info
3. Return to calendar tab
   - navigate(url="https://calendar.google.com/event/{id}", tabId=<id>)
   - Add note about attendee's company
4. Report: "Added context notes for 3 external meetings"
Example request:
"Check my calendar for meetings tomorrow, then for each meeting with
an external attendee, look up their company on LinkedIn and add a
note about what they do."
Tab management:
  • tabs_context_mcp()
    - Get current tab info
  • tabs_create_mcp()
    - Create new tab
  • Switch between tabs by using different tabId values
模式:跨多个网站协调任务
工作流:
1. 查看明天的日历会议
   - navigate(url="https://calendar.google.com", tabId=<id>)
   - get_page_text(tabId=<id>)
   - 提取会议参会人
2. 针对每个外部参会人:
   - tabs_create_mcp() → 创建新标签页
   - navigate(url="https://linkedin.com/in/{name}", tabId=<new-id>)
   - get_page_text(tabId=<new-id>)
   - 提取公司信息
3. 返回日历标签页
   - navigate(url="https://calendar.google.com/event/{id}", tabId=<id>)
   - 添加参会人公司信息备注
4. 报告:"已为3个外部会议添加背景备注"
示例请求:
"查看我明天的日历会议,然后为每个有外部参会人的会议,在LinkedIn上查找他们的公司信息,并添加备注说明其业务。"
标签页管理:
  • tabs_context_mcp()
    - 获取当前标签页信息
  • tabs_create_mcp()
    - 创建新标签页
  • 通过使用不同的tabId值在标签页间切换

MCP Tool Reference

MCP工具参考

Core Navigation:
  • navigate(url, tabId)
    - Navigate to URL
  • computer(action="left_click", coordinate/ref, tabId)
    - Click element
  • computer(action="type", text, tabId)
    - Type text
  • form_input(ref, value, tabId)
    - Fill form field (faster than typing)
Data Retrieval:
  • get_page_text(tabId)
    - Get full page text
  • read_page(tabId)
    - Get page content with structure
  • find(selector, tabId)
    - Find elements matching selector
Debugging:
  • read_console_messages(tabId, pattern, onlyErrors)
    - Get console logs
  • read_network_requests(tabId, urlPattern, filterStatus)
    - Get network requests
Tab Management:
  • tabs_context_mcp(createIfEmpty)
    - Get current tab info (always call first)
  • tabs_create_mcp()
    - Create new tab
  • browser_close(tabId)
    - Close tab
Recording:
  • gif_creator(action="start_recording", tabId)
    - Start GIF recording
  • gif_creator(action="stop_recording", tabId)
    - Stop recording
  • gif_creator(action="export", tabId, filename, options)
    - Export GIF
Visual:
  • computer(action="screenshot", tabId)
    - Take screenshot
  • browser_resize(width, height, tabId)
    - Resize browser window
For detailed parameter schemas, run:
bash
mcp-cli info claude-in-chrome/<tool-name>
See
references/mcp-tool-reference.md
for comprehensive parameter documentation.
核心导航工具:
  • navigate(url, tabId)
    - 导航至指定URL
  • computer(action="left_click", coordinate/ref, tabId)
    - 点击元素
  • computer(action="type", text, tabId)
    - 输入文本
  • form_input(ref, value, tabId)
    - 填充表单字段(比输入更快)
数据获取工具:
  • get_page_text(tabId)
    - 获取页面完整文本
  • read_page(tabId)
    - 获取带结构的页面内容
  • find(selector, tabId)
    - 查找匹配选择器的元素
调试工具:
  • read_console_messages(tabId, pattern, onlyErrors)
    - 获取控制台日志
  • read_network_requests(tabId, urlPattern, filterStatus)
    - 获取网络请求
标签页管理工具:
  • tabs_context_mcp(createIfEmpty)
    - 获取当前标签页信息(必须首先调用)
  • tabs_create_mcp()
    - 创建新标签页
  • browser_close(tabId)
    - 关闭标签页
录制工具:
  • gif_creator(action="start_recording", tabId)
    - 开始GIF录制
  • gif_creator(action="stop_recording", tabId)
    - 停止录制
  • gif_creator(action="export", tabId, filename, options)
    - 导出GIF
视觉工具:
  • computer(action="screenshot", tabId)
    - 截取屏幕截图
  • browser_resize(width, height, tabId)
    - 调整浏览器窗口大小
查看详细参数说明,请执行:
bash
mcp-cli info claude-in-chrome/<tool-name>
完整参数文档请参考
references/mcp-tool-reference.md

Best Practices

最佳实践

Always start with tab context:
tabs_context_mcp(createIfEmpty=true) → Get tabId
Without this, you won't have a valid tabId for subsequent operations.
Handle authentication gracefully:
  • Never ask for passwords or API keys
  • If you hit a login page, pause and ask user to log in manually
  • Resume workflow after user confirms "I'm logged in"
Monitor console and network during testing:
read_console_messages(tabId=<id>, onlyErrors=true)
read_network_requests(tabId=<id>, urlPattern="/api/")
Report specific errors, not generic "something failed".
Use appropriate input methods:
  • form_input
    - Text fields (fast, reliable)
  • computer(action="type")
    - Rich text editors, contenteditable
  • computer(action="left_click")
    - Buttons, links, dropdowns
Wait for page loads:
navigate(url="...", tabId=<id>)
computer(action="wait", duration=2, tabId=<id>) → Let page load
Dynamic content (AJAX, React) needs time to render.
Filter console output:
read_console_messages(
  tabId=<id>,
  pattern="error|exception|failed",
  onlyErrors=true
)
Console logs can be verbose - focus on errors.
Dismiss modal dialogs manually: JavaScript alerts/confirms block browser events. If a dialog appears, ask user to dismiss it and tell Claude to continue.
Fresh tabs for unresponsive sessions: If a tab becomes unresponsive, create a new tab:
tabs_create_mcp() → New tabId
始终先获取标签页上下文:
tabs_context_mcp(createIfEmpty=true) → 获取tabId
没有有效的tabId,后续操作无法执行。
优雅处理认证:
  • 绝不索要密码或API密钥
  • 如果遇到登录页面,暂停并提示用户手动登录
  • 用户确认"已登录"后再恢复工作流
测试时监控控制台和网络:
read_console_messages(tabId=<id>, onlyErrors=true)
read_network_requests(tabId=<id>, urlPattern="/api/")
报告具体错误信息,而非泛泛的"操作失败"。
使用合适的输入方式:
  • form_input
    - 文本字段(快速、可靠)
  • computer(action="type")
    - 富文本编辑器、可编辑内容区域
  • computer(action="left_click")
    - 按钮、链接、下拉菜单
等待页面加载完成:
navigate(url="...", tabId=<id>)
computer(action="wait", duration=2, tabId=<id>) → 等待页面加载
动态内容(AJAX、React)需要时间渲染。
过滤控制台输出:
read_console_messages(
  tabId=<id>,
  pattern="error|exception|failed",
  onlyErrors=true
)
控制台日志可能非常冗长,重点关注错误信息。
手动关闭模态对话框: JavaScript警告/确认框会阻塞浏览器事件。如果出现对话框,请提示用户手动关闭并告知Claude继续执行。
无响应会话使用新标签页: 如果标签页无响应,创建新标签页重试:
tabs_create_mcp() → 获取新tabId

Troubleshooting

故障排查

Extension not detected:
  1. Verify Claude in Chrome extension v1.0.36+ installed
  2. Verify Claude Code CLI v2.0.73+ (
    claude --version
    )
  3. Check Chrome is running
  4. Run
    /chrome
    → "Reconnect extension"
  5. Restart both Claude Code and Chrome if needed
Browser not responding:
  1. Check for modal dialog (alert, confirm, prompt) blocking page
  2. Ask Claude to create new tab and retry
  3. Restart Chrome extension (disable and re-enable)
First-time setup issues: First use installs native messaging host. If permission errors occur, restart Chrome.
Console/network requests not appearing:
  1. Verify page is fully loaded (wait 2-3 seconds after navigate)
  2. Check URL pattern matches actual requests
  3. Try without filters first (get all logs, then refine)
Form input not working:
  1. Verify element reference is correct (use
    find
    to locate)
  2. Try
    computer(action="type")
    instead of
    form_input
  3. Click into field first:
    computer(action="left_click", ref=<field>)
See
references/troubleshooting.md
for detailed diagnostic workflows.
扩展未被检测到:
  1. 确认已安装Claude in Chrome扩展 v1.0.36+
  2. 确认Claude Code CLI版本为v2.0.73+(执行
    claude --version
    查看)
  3. 确认Chrome浏览器正在运行
  4. 执行
    /chrome
    → "Reconnect extension"
  5. 必要时重启Claude Code和Chrome
浏览器无响应:
  1. 检查是否有模态对话框(警告、确认、提示)阻塞页面
  2. 让Claude创建新标签页重试
  3. 重启Chrome扩展(禁用后重新启用)
首次安装问题: 首次使用会安装原生消息主机。如果出现权限错误,请重启Chrome。
控制台/网络请求未显示:
  1. 确认页面已完全加载(导航后等待2-3秒)
  2. 检查URL模式是否匹配实际请求
  3. 先尝试不使用过滤器(获取所有日志后再筛选)
表单输入失败:
  1. 确认元素引用正确(使用
    find
    工具定位元素)
  2. 尝试使用
    computer(action="type")
    替代
    form_input
  3. 先点击输入框:
    computer(action="left_click", ref=<field>)
详细诊断流程请参考
references/troubleshooting.md

Integration with Other Skills

与其他技能集成

With chrome-gif-recorder: Record visual tutorials of web workflows with annotations.
With quality-code-review: Test changes in browser before committing (verify UI works correctly).
With observability-analyze-logs: Combine application logs with browser console for full-stack debugging.
With create-adr-spike: Research libraries by navigating documentation sites and extracting examples.
Example integrated workflow:
1. Make code changes (terminal)
2. Test in browser with console monitoring (chrome-browser-automation)
3. Record successful demo as GIF (chrome-gif-recorder)
4. Run quality gates (quality-run-quality-gates)
5. Commit with proof-of-work GIF (git commit)
与chrome-gif-recorder集成: 录制带注释的Web工作流视觉教程。
与quality-code-review集成: 提交代码前在浏览器中测试变更(验证UI功能正常)。
与observability-analyze-logs集成: 将应用日志与浏览器控制台日志结合进行全栈调试。
与create-adr-spike集成: 通过导航至文档网站并提取示例来调研开源库。
集成工作流示例:
1. 修改代码(终端)
2. 在浏览器中测试并监控控制台(chrome-browser-automation)
3. 录制成功演示的GIF(chrome-gif-recorder)
4. 执行质量检查(quality-run-quality-gates)
5. 提交代码并附上演示GIF(git commit)

Supporting Files

支持文件

references/
  • mcp-tool-reference.md
    - Detailed MCP tool parameters and schemas
  • debugging-patterns.md
    - Console/network error analysis workflows
  • troubleshooting.md
    - Common issues and diagnostic procedures
examples/
  • testing-examples.md
    - Web app testing patterns (form validation, user flows)
  • data-extraction-examples.md
    - Scraping workflows (pagination, dynamic content)
  • authenticated-app-examples.md
    - Google Docs, Gmail, Notion workflows
  • multi-site-examples.md
    - Complex multi-tab coordination patterns
references/
  • mcp-tool-reference.md
    - MCP工具详细参数和 schema
  • debugging-patterns.md
    - 控制台/网络错误分析工作流
  • troubleshooting.md
    - 常见问题和诊断流程
examples/
  • testing-examples.md
    - Web应用测试模式(表单验证、用户流程)
  • data-extraction-examples.md
    - 抓取工作流(分页、动态内容)
  • authenticated-app-examples.md
    - Google Docs、Gmail、Notion交互示例
  • multi-site-examples.md
    - 复杂多标签页协调模式

Expected Outcomes

预期输出

Successful web app test:
✅ Web App Tested Successfully

URL: http://localhost:3000/login
Test: Form validation with invalid/valid data
Console: 0 errors
Network: POST /api/auth → 200 OK (token received)
Result: Success message displayed correctly

All validations passed!
Debugging with errors found:
⚠️ Frontend Issues Detected

Console Errors:
1. TypeError: Cannot read property 'name' of undefined
   - File: dashboard.js:42
   - Cause: API response missing 'user' object

Network Failures:
1. GET /api/user/preferences → 401 Unauthorized
   - Cause: Auth token expired

Recommendations:
1. Add null check: user?.name || 'Unknown'
2. Refresh auth token before API call
Data extraction success:
✅ Data Extracted Successfully

Source: https://example.com/products
Extracted: 47 products
Fields: name, price, availability, url
Output: products.csv (8KB)

Sample data:
- Widget Pro, $49.99, In Stock, /products/widget-pro
- Gadget Plus, $79.99, Backordered, /products/gadget-plus
Web应用测试成功:
✅ Web应用测试通过

URL: http://localhost:3000/login
测试内容:使用无效/有效数据验证表单规则
控制台:0个错误
网络请求:POST /api/auth → 200 OK(已获取令牌)
结果:成功提示正确显示

所有验证项均通过!
调试发现错误:
⚠️ 检测到前端问题

控制台错误:
1. TypeError: Cannot read property 'name' of undefined
   - 文件:dashboard.js:42
   - 原因:API响应缺失'user'对象

网络请求失败:
1. GET /api/user/preferences → 401 Unauthorized
   - 原因:认证令牌过期

修复建议:
1. 添加空值检查:user?.name || 'Unknown'
2. 调用API前刷新认证令牌
数据提取成功:
✅ 数据提取完成

来源:https://example.com/products
提取数量:47个产品
字段:名称、价格、库存状态、链接
输出文件:products.csv(8KB)

示例数据:
- Widget Pro, $49.99, 有货, /products/widget-pro
- Gadget Plus, $79.99, 预售, /products/gadget-plus

Expected Benefits

预期收益

MetricBeforeAfterImprovement
Frontend debugging time15-30 min3-5 min80% faster
Form automation (50 entries)60 min manual5 min automated90% faster
Multi-site data gathering30 min5 min83% faster
Test coverage (manual check)Ad-hocSystematic100% reliability
指标自动化前自动化后提升幅度
前端调试时间15-30分钟3-5分钟提升80%效率
50条数据表单填写60分钟手动5分钟自动化提升90%效率
多站点数据收集30分钟5分钟提升83%效率
测试覆盖度(手动检查)随机抽查系统化测试100%可靠性

Success Metrics

成功标准

A successful browser automation workflow meets these criteria:
✅ Tab context retrieved before operations ✅ Navigation completed successfully ✅ Console/network monitoring included for testing ✅ Specific errors reported (not generic failures) ✅ Data extraction validated (row counts, field completeness) ✅ Form submissions confirmed (success messages visible) ✅ Authentication handled gracefully (no credential exposure) ✅ Results saved locally (CSV, JSON, screenshots)
一个成功的浏览器自动化工作流需满足以下条件:
✅ 操作前已获取标签页上下文 ✅ 导航操作执行成功 ✅ 测试过程包含控制台/网络监控 ✅ 报告具体错误信息(而非泛泛的失败) ✅ 数据提取已验证(行数、字段完整性) ✅ 表单提交已确认(成功提示可见) ✅ 认证处理优雅(无凭证泄露) ✅ 结果已保存至本地(CSV、JSON、截图)

Requirements

环境要求

Browser: Chrome with Claude in Chrome extension v1.0.36+, visible window required CLI: Claude Code v2.0.73+, started with
--chrome
flag or
/chrome
enabled Permissions: Chrome extension permissions for target sites (manage in extension settings) Network: Internet access for web navigation, local server access for development testing
浏览器: Chrome浏览器,安装Claude in Chrome扩展 v1.0.36+,需可见窗口 CLI: Claude Code v2.0.73+,启动时添加
--chrome
参数或已启用
/chrome
权限: Chrome扩展对目标站点的权限(在扩展设置中管理) 网络: 可访问互联网用于网页导航,可访问本地服务器用于开发测试

Red Flags to Avoid

注意事项

  1. Skipping tab context - Always call
    tabs_context_mcp()
    first
  2. Handling passwords - Never ask for credentials, let user log in manually
  3. Ignoring console errors - Always check console during testing
  4. Generic error reports - Report specific error messages and stack traces
  5. Not waiting for page loads - Add waits after navigation for dynamic content
  6. Skipping network monitoring - Check network requests for API failures
  7. Using wrong input method -
    form_input
    for fields,
    type
    for rich text
  8. Continuing after modal dialogs - Ask user to dismiss alerts/confirms
  9. Not verifying data extraction - Validate row counts and field completeness
  10. Exposing sensitive data - Never log passwords, tokens, or PII
  1. 跳过标签页上下文获取 - 必须首先调用
    tabs_context_mcp()
  2. 处理密码 - 绝不索要凭证,让用户手动登录
  3. 忽略控制台错误 - 测试时必须检查控制台
  4. 泛泛的错误报告 - 报告具体错误信息和堆栈跟踪
  5. 未等待页面加载 - 导航后添加等待时间以处理动态内容
  6. 跳过网络监控 - 检查网络请求以排查API失败
  7. 使用错误的输入方式 - 文本字段用
    form_input
    ,富文本用
    type
  8. 模态对话框后继续执行 - 提示用户关闭警告/确认框后再继续
  9. 未验证数据提取 - 验证提取数据的行数和字段完整性
  10. 泄露敏感数据 - 绝不记录密码、令牌或个人身份信息

Notes

说明

Architecture:
  • Claude Code (CLI) ↔ Native Messaging API ↔ Claude in Chrome Extension ↔ Browser
  • Extension has same permissions as your browser (site-level permissions inherited)
  • No headless mode - browser window must be visible
Privacy:
  • Uses existing browser login state (no credential storage)
  • Browser automation shares your session (cookies, tokens)
  • Screenshot/GIF recording captures visible content only
Performance:
  • Console logs can be verbose (filter with pattern/onlyErrors)
  • Network requests accumulate (use urlPattern to filter)
  • Page loads vary (wait 2-3 seconds for dynamic content)
Limitations:
  • Google Chrome only (Brave, Arc, other Chromium browsers not supported)
  • WSL (Windows Subsystem for Linux) not supported
  • Modal dialogs (alert/confirm/prompt) block automation
  • CAPTCHAs and login pages require manual user intervention
Context usage:
  • Enabling
    --chrome
    by default increases context usage (all tools loaded)
  • Use flag only when needed if context consumption is a concern
  • Run
    /chrome
    to check current settings
架构:
  • Claude Code (CLI) ↔ 原生消息API ↔ Claude in Chrome扩展 ↔ 浏览器
  • 扩展拥有与浏览器相同的权限(继承站点级权限)
  • 不支持无头模式 - 浏览器窗口必须可见
隐私:
  • 使用浏览器已有的登录状态(不存储凭证)
  • 浏览器自动化会共享你的会话(Cookie、令牌)
  • 截图/GIF录制仅捕获可见内容
性能:
  • 控制台日志可能冗长(使用pattern/onlyErrors筛选)
  • 网络请求会累积(使用urlPattern筛选)
  • 页面加载时间不同(动态内容等待2-3秒)
限制:
  • 仅支持Google Chrome(不支持Brave、Arc或其他Chromium浏览器)
  • 不支持WSL(Windows Subsystem for Linux)
  • 模态对话框(alert/confirm/prompt)会阻塞自动化
  • CAPTCHA和登录页面需要用户手动干预
上下文使用:
  • 默认启用
    --chrome
    会增加上下文使用量(加载所有工具)
  • 如果关注上下文消耗,仅在需要时启用该参数
  • 执行
    /chrome
    查看当前设置