chrome-devtools-automation

Automates the Chrome DevTools front end over CDP to switch panels, click UI elements, and capture screenshots.

1|Updated Apr 24, 2025
One-click install
npx skills add https://github.com/Kobayashi2003/EasyPwsh --skill chrome-devtools-automation-kobayashi2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chrome-devtools-automation
Source: https://github.com/Kobayashi2003/EasyPwsh/tree/main/config/skills/chrome-devtools-automation
Command: npx skills add https://github.com/Kobayashi2003/EasyPwsh --skill chrome-devtools-automation-kobayashi2003

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Playwright and the page-level CDP session can drive the web page under test, but neither can operate the Chrome DevTools UI itself — switching panels, clearing the network log, or selecting rows in the cookie tree. This Skill connects to the DevTools front end as its own CDP target and scripts its shadow-DOM-based UI directly. ## Core Features & Use Cases - Panel and Command Menu automation: Switch to any DevTools panel (Network, Application, Elements, Console) by clicking its tab or routing through the Command Menu when the tab is hidden in the overflow. - Shadow-DOM-aware interaction: Deep-query elements across nested shadow roots, dispatch real mouse and rawKeyDown input events, and poll predicates instead of fixed sleeps. - Recipes and screenshots: Clear the network log, select a site's cookie table in the Application panel, and capture PNG screenshots of the DevTools UI via Page.captureScreenshot. - Use Case: While debugging a web app, you need a screenshot of the Network panel with a clean log. Connect to the DevTools target, run Select-DevToolsPanel tab-network, Clear-NetworkLog, then Save-DevToolsScreenshot to produce the image. ## Quick Start Launch Chrome with --remote-debugging-port=9333 and --auto-open-devtools-for-tabs, then ask the assistant to connect to the DevTools window for your page and open the Network panel.

Frequently Asked Questions about chrome-devtools-automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate the Chrome DevTools UI with CDP?

Connect to the DevTools front end as its own CDP target by launching Chrome with --remote-debugging-port and --auto-open-devtools-for-tabs, then open a WebSocket to the devtools:// target listed at /json. Send CDP commands like Runtime.evaluate and Input.dispatchMouseEvent over that socket.

How do I switch DevTools panels programmatically?

Click the panel's tab element using real mouse input at its bounding-box center; stable tab ids include tab-network, tab-elements, and tab-resources for Application. If the tab is hidden in the overflow menu, use the Command Menu (Ctrl+Shift+P) with Input.insertText to run 'Show <panel name>'.

Why does document.querySelector find nothing in DevTools?

The entire DevTools UI is built from nested shadow roots, so a plain querySelector on the document cannot see inside them. You must recursively walk every element's shadowRoot, which the provided deep-query helpers do with depth and node-count limits.

Can Playwright control the Chrome DevTools panels?

No. Playwright and the page CDP session drive the page under test, not the DevTools front end, which is a separate CDP target. You must open a second WebSocket connection to the devtools:// target to script panels, trees, and toolbar buttons.

Why does element.click() not work inside DevTools?

DevTools widgets ignore synthetic click() calls and respond only to real input events. Read the element's bounding box and dispatch Input.dispatchMouseEvent with mouseMoved, mousePressed, and mouseReleased at its center; the hover step matters because some buttons only accept presses once hovered.

Why does my CDP client return wrong or truncated responses?

A CDP socket interleaves events with responses, so reading one frame may return an event instead of your result; correlate on a unique request id. Large Runtime.evaluate payloads also span multiple frames, so reassemble until EndOfMessage before parsing.