Loading...
Loading...
Compare original and translation side by side
Skill by ara.so — MCP Skills collection.
chrome-devtools-mcp由ara.so提供的Skill —— MCP Skills合集。
chrome-devtools-mcp{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--no-usage-statistics",
"--no-performance-crux"
]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--no-usage-statistics",
"--no-performance-crux"
]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--browser-url=http://127.0.0.1:9222"
]
}
}
}{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--browser-url=http://127.0.0.1:9222"
]
}
}
}undefinedundefinedundefinedundefined| Flag | Description |
|---|---|
| Run Chrome in headless mode (no UI) |
| Enable slim mode (basic tools only) |
| Opt out of Google usage statistics collection |
| Disable Chrome UX Report (CrUX) API calls |
| Connect to existing Chrome instance at URL |
| Use custom Chrome profile directory |
| 标识 | 描述 |
|---|---|
| 以无头模式运行Chrome(无用户界面) |
| 启用精简模式(仅基础工具) |
| 选择退出Google使用统计数据收集 |
| 禁用Chrome用户体验报告(CrUX)API调用 |
| 连接到指定URL的已运行Chrome实例 |
| 使用自定义Chrome配置文件目录 |
undefinedundefinedundefinedundefined// MCP tool call: navigate
{
"url": "https://example.com",
"waitUntil": "networkidle0"
}// MCP tool call: click
{
"selector": "button.submit",
"waitForNavigation": true
}// MCP tool call: type
{
"selector": "input[name='email']",
"text": "user@example.com",
"delay": 100
}// MCP tool call: evaluate
{
"script": "document.querySelector('h1').textContent",
"returnByValue": true
}// MCP工具调用:navigate
{
"url": "https://example.com",
"waitUntil": "networkidle0"
}// MCP工具调用:click
{
"selector": "button.submit",
"waitForNavigation": true
}// MCP工具调用:type
{
"selector": "input[name='email']",
"text": "user@example.com",
"delay": 100
}// MCP工具调用:evaluate
{
"script": "document.querySelector('h1').textContent",
"returnByValue": true
}// MCP tool call: screenshot
{
"fullPage": true,
"path": "./screenshots/page.png"
}// MCP tool call: screenshot
{
"selector": "div.product-card",
"path": "./element.png"
}// MCP工具调用:screenshot
{
"fullPage": true,
"path": "./screenshots/page.png"
}// MCP工具调用:screenshot
{
"selector": "div.product-card",
"path": "./element.png"
}// MCP tool call: network-logs
{
"filter": {
"type": "fetch",
"status": 200
}
}// MCP tool call: network-logs
{
"filter": {
"failed": true
}
}// MCP工具调用:network-logs
{
"filter": {
"type": "fetch",
"status": 200
}
}// MCP工具调用:network-logs
{
"filter": {
"failed": true
}
}// MCP tool call: console-logs
{
"level": "error" // or "warning", "info", "log"
}// MCP tool call: evaluate
{
"script": `
const errors = [];
window.addEventListener('error', (e) => {
errors.push({ message: e.message, stack: e.error.stack });
});
errors;
`,
"returnByValue": true
}// MCP工具调用:console-logs
{
"level": "error" // 或 "warning", "info", "log"
}// MCP工具调用:evaluate
{
"script": `
const errors = [];
window.addEventListener('error', (e) => {
errors.push({ message: e.message, stack: e.error.stack });
});
errors;
`,
"returnByValue": true
}// MCP tool call: start-trace
{
"categories": ["devtools.timeline", "v8.execute", "disabled-by-default-v8.cpu_profiler"]
}
// ... perform actions ...
// MCP tool call: stop-trace
{
"path": "./traces/performance.json"
}// MCP tool call: get-metrics
{
"includeMemory": true
}// MCP tool call: web-vitals
{
"url": "https://example.com",
"includeCrux": true // Include real-user data from CrUX
}// MCP工具调用:start-trace
{
"categories": ["devtools.timeline", "v8.execute", "disabled-by-default-v8.cpu_profiler"]
}
// ... 执行操作 ...
// MCP工具调用:stop-trace
{
"path": "./traces/performance.json"
}// MCP工具调用:get-metrics
{
"includeMemory": true
}// MCP工具调用:web-vitals
{
"url": "https://example.com",
"includeCrux": true // 包含来自CrUX的真实用户数据
}// 1. Navigate to login page
// Tool: navigate
{ "url": "https://app.example.com/login" }
// 2. Fill credentials
// Tool: type
{ "selector": "#username", "text": "testuser" }
{ "selector": "#password", "text": "secure_password" }
// 3. Submit form
// Tool: click
{ "selector": "button[type='submit']", "waitForNavigation": true }
// 4. Verify success
// Tool: evaluate
{ "script": "window.location.pathname === '/dashboard'" }
// 5. Capture proof
// Tool: screenshot
{ "path": "./test-evidence/login-success.png" }// 1. 导航至登录页面
// 工具:navigate
{ "url": "https://app.example.com/login" }
// 2. 填写凭证
// 工具:type
{ "selector": "#username", "text": "testuser" }
{ "selector": "#password", "text": "secure_password" }
// 3. 提交表单
// 工具:click
{ "selector": "button[type='submit']", "waitForNavigation": true }
// 4. 验证成功
// 工具:evaluate
{ "script": "window.location.pathname === '/dashboard'" }
// 5. 捕获验证证据
// 工具:screenshot
{ "path": "./test-evidence/login-success.png" }// 1. Start trace recording
// Tool: start-trace
{ "categories": ["devtools.timeline", "loading", "blink.user_timing"] }
// 2. Navigate to page
// Tool: navigate
{ "url": "https://example.com/product/123", "waitUntil": "networkidle0" }
// 3. Stop trace
// Tool: stop-trace
{ "path": "./audits/product-page-trace.json" }
// 4. Get Core Web Vitals
// Tool: web-vitals
{ "url": "https://example.com/product/123", "includeCrux": true }
// 5. Analyze metrics
// Tool: get-metrics
{ "includeMemory": true }// 1. 启动跟踪记录
// 工具:start-trace
{ "categories": ["devtools.timeline", "loading", "blink.user_timing"] }
// 2. 导航至页面
// 工具:navigate
{ "url": "https://example.com/product/123", "waitUntil": "networkidle0" }
// 3. 停止跟踪
// 工具:stop-trace
{ "path": "./audits/product-page-trace.json" }
// 4. 获取核心Web指标
// 工具:web-vitals
{ "url": "https://example.com/product/123", "includeCrux": true }
// 5. 分析指标
// 工具:get-metrics
{ "includeMemory": true }// 1. Navigate to problematic page
// Tool: navigate
{ "url": "https://example.com/checkout" }
// 2. Monitor network for failed requests
// Tool: network-logs
{ "filter": { "failed": true } }
// 3. Capture console errors
// Tool: console-logs
{ "level": "error" }
// 4. Get JavaScript errors with stack traces
// Tool: evaluate
{
"script": `
window.__errors = [];
window.addEventListener('error', (e) => {
__errors.push({
message: e.message,
filename: e.filename,
lineno: e.lineno,
colno: e.colno,
stack: e.error?.stack
});
});
setTimeout(() => __errors, 5000);
`,
"returnByValue": true
}
// 5. Screenshot for visual context
// Tool: screenshot
{ "fullPage": true, "path": "./debug/error-state.png" }// 1. 导航至问题页面
// 工具:navigate
{ "url": "https://example.com/checkout" }
// 2. 监控网络中的失败请求
// 工具:network-logs
{ "filter": { "failed": true } }
// 3. 捕获控制台错误
// 工具:console-logs
{ "level": "error" }
// 4. 获取带堆栈跟踪的JavaScript错误
// 工具:evaluate
{
"script": `
window.__errors = [];
window.addEventListener('error', (e) => {
__errors.push({
message: e.message,
filename: e.filename,
lineno: e.lineno,
colno: e.colno,
stack: e.error?.stack
});
});
setTimeout(() => __errors, 5000);
`,
"returnByValue": true
}
// 5. 截图获取视觉上下文
// 工具:screenshot
{ "fullPage": true, "path": "./debug/error-state.png" }// 1. Navigate to target page
// Tool: navigate
{ "url": "https://example.com/products" }
// 2. Wait for dynamic content
// Tool: wait-for-selector
{ "selector": "div.product-list", "timeout": 5000 }
// 3. Extract structured data
// Tool: evaluate
{
"script": `
Array.from(document.querySelectorAll('.product-card')).map(card => ({
title: card.querySelector('h3').textContent.trim(),
price: card.querySelector('.price').textContent.trim(),
url: card.querySelector('a').href,
inStock: !card.querySelector('.out-of-stock')
}))
`,
"returnByValue": true
}
// 4. Handle pagination
// Tool: click
{ "selector": "button.next-page", "waitForNavigation": true }// 1. 导航至目标页面
// 工具:navigate
{ "url": "https://example.com/products" }
// 2. 等待动态内容加载
// 工具:wait-for-selector
{ "selector": "div.product-list", "timeout": 5000 }
// 3. 提取结构化数据
// 工具:evaluate
{
"script": `
Array.from(document.querySelectorAll('.product-card')).map(card => ({
title: card.querySelector('h3').textContent.trim(),
price: card.querySelector('.price').textContent.trim(),
url: card.querySelector('a').href,
inStock: !card.querySelector('.out-of-stock')
}))
`,
"returnByValue": true
}
// 4. 处理分页
// 工具:click
{ "selector": "button.next-page", "waitForNavigation": true }// 1. Set consistent viewport
// Tool: set-viewport
{ "width": 1280, "height": 720, "deviceScaleFactor": 1 }
// 2. Navigate to page
// Tool: navigate
{ "url": "https://example.com/landing" }
// 3. Wait for animations to complete
// Tool: wait-for-timeout
{ "timeout": 2000 }
// 4. Take baseline screenshot
// Tool: screenshot
{
"fullPage": true,
"path": "./visual-tests/baseline.png"
}
// 5. Compare against previous baseline (in your test framework)
// Tool: screenshot
{
"fullPage": true,
"path": "./visual-tests/current.png"
}// 1. 设置一致的视口
// 工具:set-viewport
{ "width": 1280, "height": 720, "deviceScaleFactor": 1 }
// 2. 导航至页面
// 工具:navigate
{ "url": "https://example.com/landing" }
// 3. 等待动画完成
// 工具:wait-for-timeout
{ "timeout": 2000 }
// 4. 拍摄基准截图
// 工具:screenshot
{
"fullPage": true,
"path": "./visual-tests/baseline.png"
}
// 5. 与之前的基准截图对比(在你的测试框架中)
// 工具:screenshot
{
"fullPage": true,
"path": "./visual-tests/current.png"
}undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined// Increase timeout for slow pages
// Tool: navigate
{
"url": "https://slow-site.com",
"timeout": 60000,
"waitUntil": "domcontentloaded" // Less strict than "networkidle0"
}// 为加载缓慢的页面增加超时时间
// 工具:navigate
{
"url": "https://slow-site.com",
"timeout": 60000,
"waitUntil": "domcontentloaded" // 比"networkidle0"要求更低
}// Remove --headless flag temporarily to debug
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}// 临时移除--headless标识以调试
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}// Close and reopen browser periodically
// Tool: close-browser
{}
// Browser will auto-restart on next tool call// 定期关闭并重新打开浏览器
// 工具:close-browser
{}
// 下次工具调用时浏览器将自动重启undefined// 确保源映射与应用一起部署
// 在网络标签中检查.map文件请求
// 工具:network-logs
{ "filter": { "type": "other" } }undefinedundefinedundefinedundefinedundefined--no-usage-statisticsCHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1--no-performance-crux--no-usage-statisticsCHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1--no-performance-crux--slim--headlesschrome-devtools-mcp@X.Y.Z@latestnetwork-logs--slim--headlesschrome-devtools-mcp@X.Y.Z@latestnetwork-logs