chrome-devtools
它能做什么
这个工具可以替你控制 Chrome 浏览器。它能打开网站、点击按钮、填写表单、进行“截图”,甚至分析网站的加载速度。
适用场景
- ✓当你希望 AI 帮你填写网站上的表单时。
- ✓当你需要为某个网页截图,并发给别人看时。
- ✓当你想知道网站加载为什么这么慢时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/chrome-devtools/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“截取我网站首页的截图,并告诉我控制台里有没有报错。”
每周 5 个新技能,1 分钟读完。
工作原理
它通过连接 Chrome,并向浏览器发出指令来工作。你可以把它想象成你在指挥浏览器执行具体的操作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Chrome DevTools Agent
Overview
A specialized skill for controlling and inspecting a live Chrome browser. This skill leverages the chrome-devtools MCP server to perform a wide range of browser-related tasks, from simple navigation to complex performance profiling.
When to Use
Use this skill when:
- Browser Automation: Navigating pages, clicking elements, filling forms, and handling dialogs.
- Visual Inspection: Taking screenshots or text snapshots of web pages.
- Debugging: Inspecting console messages, evaluating JavaScript in the page context, and analyzing network requests.
- Performance Analysis: Recording and analyzing performance traces to identify bottlenecks and Core Web Vital issues.
- Emulation: Resizing the viewport or emulating network/CPU conditions.
Tool Categories
1. Navigation & Page Management
new_page: Open a new tab/page.navigate_page: Go to a specific URL, reload, or navigate history.select_page: Switch context between open pages.list_pages: See all open pages and their IDs.close_page: Close a specific page.wait_for: Wait for specific text to appear on the page.
2. Input & Interaction
click: Click on an element (useuidfrom snapshot).fill/fill_form: Type text into inputs or fill multiple fields at once.hover: Move the mouse over an element.press_key: Send keyboard shortcuts or special keys (e.g., "Enter", "Control+C").drag: Drag and drop elements.handle_dialog: Accept or dismiss browser alerts/prompts.upload_file: Upload a file through a file input.
3. Debugging & Inspection
take_snapshot: Get a text-based accessibility tree (best for identifying elements).take_screenshot: Capture a visual representation of the page or a specific element.list_console_messages/get_console_message: Inspect the page's console output.evaluate_script: Run custom JavaScript in the page context.list_network_requests/get_network_request: Analyze network traffic and request details.
4. Emulation & Performance
resize_page: Change the viewport dimensions.emulate: Throttling CPU/Network or emulating geolocation.performance_start_trace: Start recording a performance profile.performance_stop_trace: Stop recording and save the trace.performance_analyze_insight: Get detailed analysis from recorded performance data.
Workflow Patterns
Pattern A: Identifying Elements (Snapshot-First)
Always prefer take_snapshot over take_screenshot for finding elements. The snapshot provides uid values which are required by interaction tools.
1. `take_snapshot` to get the current page structure.
2. Find the `uid` of the target element.
3. Use `click(uid=...)` or `fill(uid=..., value=...)`.
Pattern B: Troubleshooting Errors
When a page is failing, check both console logs and network requests.
1. `list_console_messages` to check for JavaScript errors.
2. `list_network_requests` to identify failed (4xx/5xx) resources.
3. `evaluate_script` to check the value of specific DOM elements or global variables.
Pattern C: Performance Profiling
Identify why a page is slow.
1. `performance_start_trace(reload=true, autoStop=true)`
2. Wait for the page to load/trace to finish.
3. `performance_analyze_insight` to find LCP issues or layout shifts.
Best Practices
- Context Awareness: Always run
list_pagesandselect_pageif you are unsure which tab is currently active. - Snapshots: Take a new snapshot after any major navigation or DOM change, as
uidvalues may change. - Timeouts: Use reasonable timeouts for
wait_forto avoid hanging on slow-loading elements. - Screenshots: Use
take_screenshotsparingly for visual verification, but rely ontake_snapshotfor logic.
常见问题
AI 怎么知道该点击或输入页面的哪个位置?
它会使用页面的一份“快照”,这是页面的结构地图,用来找到正确的按钮和输入框。可以理解为,页面上的每个元素都有一个唯一的标识。
我可以用它访问需要登录的网站吗?
可以。你可以让 AI 打开登录页面、填写你的账号密码,然后再与网站进行交互。
什么是 Core Web Vitals?
它们是衡量用户在网站上体验的重要指标,包括加载速度、交互响应性和视觉稳定性。这个工具可以帮你分析网站在这些方面的表现如何。
详情
作者的原始描述
Expert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analyzing network traffic, and profiling performance.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7106
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。