chrome-devtools
Chrome DevTools Protocol Skill
Purpose
Provides Chrome DevTools Protocol (CDP) access through a local Docker container, enabling browser debugging, network inspection, performance profiling, and DOM manipulation without remote MCP dependencies.
Capabilities
- Page Control: Navigate, reload, screenshot
- JavaScript Execution: Evaluate scripts in browser context
- Network Monitoring: Capture requests, responses, timing
- DOM Inspection: Query and manipulate DOM elements
- Performance: Profiling, metrics, Core Web Vitals
- Console: Capture console logs and errors
Requirements
Docker
- Docker Desktop installed and running
agent-networkDocker network created- Chrome DevTools container running
Ruby
- Ruby ≥2.7
- Gems:
websocket-client-simple,json,net-http
Setup
# Start Chrome DevTools container
cd ~/.claude/skills/chrome-devtools/docker
docker-compose up -d
# Verify container is running
docker ps | grep chrome-devtools-server
# Check CDP endpoint
curl http://localhost:9222/json/version
Usage
Page Navigation
# Navigate to URL
~/.claude/skills/chrome-devtools/scripts/navigate.rb "https://example.com"
JavaScript Evaluation
# Execute JavaScript
~/.claude/skills/chrome-devtools/scripts/evaluate.rb "document.title"
# Get complex data
~/.claude/skills/chrome-devtools/scripts/evaluate.rb "Array.from(document.querySelectorAll('a')).map(a => a.href)"
Network Monitoring
# Capture network traffic
~/.claude/skills/chrome-devtools/scripts/network_capture.rb "https://example.com" 5
# Arguments: URL, duration (seconds)
Screenshots
# Capture screenshot
~/.claude/skills/chrome-devtools/scripts/screenshot.rb /tmp/screenshot.png
# JPEG with quality
~/.claude/skills/chrome-devtools/scripts/screenshot.rb /tmp/screenshot.jpg --format jpeg --quality 80
Console Logs
# Monitor console output
~/.claude/skills/chrome-devtools/scripts/console_log.rb "https://example.com" 10
# Arguments: URL, duration (seconds)
Docker Management
Start Container
~/.claude/skills/chrome-devtools/scripts/start.sh
Stop Container
~/.claude/skills/chrome-devtools/scripts/stop.sh
Restart Container
~/.claude/skills/chrome-devtools/scripts/restart.sh
Check Status
~/.claude/skills/chrome-devtools/scripts/status.sh
VNC Access (Visual Debugging)
# Get VNC connection details
~/.claude/skills/chrome-devtools/scripts/vnc_url.sh
# Connect with VNC viewer to: vnc://localhost:5900
# Password: secret
Troubleshooting
Container won't start
Symptom: docker-compose up -d fails
Solutions:
- Check Docker Desktop is running
- Verify SHM size setting (Chrome needs shared memory)
- Check logs:
docker-compose logs - Try with increased shm_size in docker-compose.yml
CDP connection failed
Symptom: Can't connect to WebSocket
Solutions:
- Verify container is running:
docker ps | grep chrome - Check CDP endpoint:
curl http://localhost:9222/json - Verify port not in use:
lsof -i :9222 - Check container logs:
docker logs chrome-devtools-server
Browser crashed
Symptom: CDP commands fail with "Target closed"
Solutions:
- Restart container:
docker-compose restart - Check memory limits (Chrome needs ≥1GB)
- Review crash logs:
docker logs chrome-devtools-server
VNC not working
Symptom: Can't connect to VNC
Solutions:
- Verify VNC port exposed:
docker port chrome-devtools-server - Check DEFAULT_HEADLESS=false in environment
- Try different VNC client
- Restart container:
docker-compose restart
Performance Notes
- Container startup: ~15-20 seconds
- CDP response time: <200ms typical
- Memory usage: ~800MB-1.5GB
- Supports up to 5 concurrent sessions (configurable)
Advanced Configuration
Headless vs Headed Mode
Edit docker-compose.yml environment:
environment:
- DEFAULT_HEADLESS=false # Enable headed mode for VNC
Session Limits
environment:
- MAX_CONCURRENT_SESSIONS=10
Preboot Optimization
environment:
- PREBOOT_CHROME=true # Faster first connection
CDP Domains Reference
Commonly Used Domains
- Page: Navigation, lifecycle, resources
- Runtime: JavaScript evaluation, console
- Network: Request/response monitoring
- DOM: Document structure, queries
- Performance: Metrics, profiling
- Debugger: Breakpoints, stepping
- Profiler: CPU/Memory profiling
Event Subscription Example
require_relative 'cdp_client'
client = CDPClient.new
client.network_enable
client.on_event('Network.requestWillBeSent') do |params|
puts "Request: #{params['request']['url']}"
end
client.page_navigate('https://example.com')
sleep 5 # Capture traffic
See Also
- Playwright skill for browser automation
- CDP Protocol documentation: https://chromedevtools.github.io/devtools-protocol/
- Original research:
~/.claude/claudedocs/research_mcp_to_agent_skill_conversion_20251116.md
More from arlenagreer/claude_configuration_docs
commit
ALWAYS use this skill when committing code changes — never commit directly without it. Creates commits following Sentry conventions with proper conventional commit format and issue references. Trigger on any commit, git commit, save changes, or commit message task.
12google-sheets
Manage Google Sheets with comprehensive spreadsheet operations including reading/writing cell values, formulas, formatting, sheet management, and batch operations. Use for spreadsheet data operations, cell ranges, formulas, formatting, batch updates, and data analysis workflows. Shares OAuth token with email, calendar, contacts, drive, and docs skills.
11invoice
Generate professional invoices for clients using standardized templates with automatic invoice numbering and client management. This skill should be used when creating invoices for American Laboratory Trading, Empirico, Versa Computing, or other clients with tracked invoice histories.
10playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, debug web apps, record browser sessions as video, mock or intercept API requests, manage browser cookies/localStorage, generate Playwright test code, capture execution traces, or run multiple browser sessions concurrently.
10omnifocus
Manage OmniFocus projects and tasks programmatically. This skill should be used when creating, reading, updating, or listing OmniFocus tasks and projects. Supports all OmniFocus versions through intelligent automation method detection (Omni Automation → AppleScript → SQLite read-only fallback). Use for task management workflows, project queries, task completion tracking, and OmniFocus data operations.
10obsidian-file-manager
>
10