Automate Chrome without Selenium or Puppeteer
Chrome DevTools Protocol gives you direct access to the browser engine. No middleware, no bloated dependencies, no headless browser overhead. Just your code talking to Chrome.
Selenium is 200MB of "works on my machine"
You want to automate a browser. So you install Selenium, or Puppeteer, or Playwright. You get a 200MB dependency tree, a separate browser binary, version mismatches, and flaky timeouts.
Meanwhile, your Chrome is already running. It already has a DevTools Protocol endpoint. You can connect to it with a single WebSocket call and control everything: navigation, DOM, network, cookies, storage, screenshots, PDFs.
CDP is what Chrome DevTools itself uses. It's not a wrapper around a wrapper. It's the actual protocol.
const ws = new WebSocket('ws://127.0.0.1:9222/devtools/browser');
await send('Page.navigate', { url: 'https://example.com' });
const { data } = await send('Page.captureScreenshot');
What's inside
1
CDP from scratch guide — How the protocol works, how to enable it, how to connect. No prior knowledge needed, but written for developers who can read code.
2
15 ready-to-run scripts — Page automation, form filling, screenshot capture, network interception, cookie management, PDF generation. Copy, paste, modify.
3
AI agent integration patterns — How to let an LLM control a browser session via CDP. The exact architecture used to run autonomous browser agents 24/7.
4
Session persistence — Connect to your real Chrome with all your logins, cookies, and extensions intact. No separate browser instance needed.
5
Network interception cookbook — Modify requests/responses in flight, block tracking scripts, inject custom JS.
6
Troubleshooting playbook — The 12 most common CDP issues and how to fix them.
Questions
- What format is this?
- PDF guide + code files (.js/.mjs). Everything runs on Node.js 18+.
- Do I need Chrome specifically?
- CDP works with any Chromium-based browser: Chrome, Edge, Brave, Arc.
- How is this different from Puppeteer?
- Puppeteer is a wrapper around CDP. This teaches you the protocol directly. You'll understand what Puppeteer does under the hood, and you'll be able to do things Puppeteer can't.
- Will this work on Windows/Mac/Linux?
- Yes. CDP is cross-platform. The guide covers setup for all three.