Chrome Devtools
Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing perfor
What Is Chrome Devtools?
The Chrome Devtools skill is a powerful browser automation and debugging toolkit built on top of Puppeteer and exposed via a CLI agent. Designed for developers and technical users, it enables end-to-end browser automation, web scraping, performance measurement, network analysis, and screenshot capture, all through programmatically executed scripts. This skill is particularly useful for tasks that require interaction with web pages in a real browser environment, such as form submission, JavaScript debugging, and monitoring resource loading.
By leveraging Puppeteer—a Node.js library that provides a high-level API to control Chrome or Chromium—the Chrome Devtools skill provides a robust and scriptable interface for automating browser actions and collecting detailed diagnostic data. All outputs are formatted as JSON, which ensures seamless integration into automated workflows or further data processing pipelines.
Why Use Chrome Devtools?
Automating browser tasks is essential for modern development and testing workflows. Chrome Devtools offers several advantages:
- End-to-End Automation: Automate repetitive web tasks, such as form filling, UI testing, and navigation, reducing manual effort.
- Performance Analysis: Gather metrics on page load times, resource usage, and bottlenecks to optimize web applications.
- Debugging: Inspect and debug client-side scripts by capturing console output, JavaScript errors, and DOM changes.
- Network Monitoring: Capture and analyze network requests to troubleshoot API calls or investigate third-party integrations.
- Web Scraping: Extract structured data from dynamic sites rendered with JavaScript, which traditional HTTP clients struggle with.
- Screenshot Capture: Generate visual records of page states for documentation, regression tests, or UI review.
Compared to standalone browser devtools or headless browsers, this skill combines the flexibility of scripting with the reliability and fidelity of a real Chrome instance.
How to Get Started
1. Install System
Dependencies (Linux/WSL Only)
Chrome and Chromium require specific libraries on Linux-based systems. Run the following commands in your terminal:
pwd # Confirm you're in the correct working directory
cd .claude/skills/chrome-devtools/scripts
./install-deps.sh # Detects your OS and installs needed librariesSupported distributions: Ubuntu, Debian, Fedora, RHEL, CentOS, Arch, Manjaro
Note: macOS and Windows users can skip this step as dependencies are already bundled with Chrome.
2. Install
Node.js Dependencies
Navigate to the skill directory and install the required Node modules:
npm install # Installs puppeteer, debug, yargs3. (Optional) Install ImageMagick for Screenshot Compression
For automatic compression of screenshots (recommended for large captures):
- macOS:
brew install imagemagick - Ubuntu/Debian/WSL:
sudo apt-get install imagemagick - Verify Installation:
magick -version
Without ImageMagick, screenshots larger than 5MB may not be compressed and could fail to load in some environments.
4. Test Your
Installation
Run a basic navigation script to verify everything is working:
node navigateThis should launch a browser, perform its scripted actions, and output results as JSON.
Key Features
- Headless and Headed Modes: Run scripts in the background or with a visible browser UI for interactive debugging.
- Automated Navigation: Programmatically visit URLs, follow links, and interact with page elements.
- Screenshot Capture: Take full-page or viewport-specific screenshots and compress them automatically if ImageMagick is installed.
- Performance Tracing: Collect metrics on loading times, resource utilization, and JavaScript execution.
- Network Traffic Analysis: Intercept, log, and analyze network requests and responses.
- Web Scraping: Extract structured data from modern, JavaScript-driven websites.
- Form Automation: Fill out and submit forms, simulate user input, and handle authentication flows.
- JavaScript Debugging: Capture console logs, DOM events, and JavaScript errors for troubleshooting.
Example:
Taking a Screenshot
Here’s a sample script to capture a screenshot of a webpage:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'example.png', fullPage: true });
await browser.close();
})();This script can be generalized or extended for more complex automation tasks.
Best Practices
- Always Check Your Working Directory: Run
pwdto ensure scripts execute in the intended location, avoiding accidental file placement or permission issues. - Use Headless Mode for Automation: To improve speed and resource usage, run scripts in headless mode unless you need to debug interactively.
- Leverage JSON Output: Integrate outputs into CI/CD pipelines or further processing scripts by parsing the generated JSON.
- Automate Screenshot Compression: Install ImageMagick to keep screenshot sizes manageable and compatible with downstream tools.
- Monitor Resource Usage: When running multiple or intensive scripts, monitor CPU and memory usage to prevent local system slowdowns.
Important Notes
- System Dependencies: Linux users must install required libraries. Skipping this step may result in browser launch failures.
- Screenshot Size Limits: Screenshots over 5MB may not be usable in certain environments. Install ImageMagick to avoid this issue.
- Security: Automated browser scripts can interact with sensitive data. Use caution when storing or transmitting outputs, especially in shared or CI environments.
- Chromium vs. Chrome: Puppeteer defaults to Chromium but can be configured to use a full Chrome installation. Adjust your scripts as needed for compatibility.
- Script Maintenance: Regularly update dependencies to benefit from security patches and performance improvements.
The Chrome Devtools skill bridges the gap between manual browser testing and fully automated web development workflows, making it an essential tool for developers, testers, and automation engineers.
More Skills You Might Like
Explore similar skills to enhance your workflow
On-Call Handoff Patterns
Effective patterns for on-call shift transitions, ensuring continuity, context transfer, and reliable incident response across shifts
React Dev
Develop and integrate modern React applications with efficient component-based workflows
Building Ransomware Playbook with CISA Framework
Builds a structured ransomware incident response playbook aligned with the CISA StopRansomware Guide and NIST
Update Specification
update-specification skill for programming & development
Copilot SDK
Boost programming and development productivity with the Copilot SDK skill
Customer Journey Mapping Workshop
Run a customer journey mapping workshop with adaptive questions and outputs. Use when you need to map stages, actions, emotions, pain points, and