# What is the Chrome DevTools Protocol?

> The Chrome DevTools Protocol is the JSON-over-WebSocket interface DevTools, Puppeteer and Playwright use to inspect and drive Chrome and Chromium browsers.

Source: https://mosaicbrowser.com/glossary/chrome-devtools-protocol

## Chrome DevTools Protocol: how tools drive Chromium

The Chrome DevTools Protocol (CDP) is the JSON interface, usually spoken over a WebSocket, that lets an outside program inspect and control a Chromium browser. The DevTools window, Puppeteer and Playwright all drive Chrome through it.

![Chrome DevTools Protocol, drawn as a mosaic of tiles](https://mosaicbrowser.com/covers/chrome-devtools-protocol.webp)

Every time you open DevTools on a page, the panel you see is a separate program talking to the page over the Chrome DevTools Protocol. Puppeteer, Playwright, Lighthouse and ChromeDriver talk the same protocol. A client sends a JSON message such as `{"id":1,"method":"Page.navigate","params":{"url":"https://example.com"}}`, the browser does it and answers with the same `id`, and in between the browser pushes events the client asked to hear about.

## How the Chrome DevTools Protocol is organised

The [protocol documentation](https://chromedevtools.github.io/devtools-protocol/) splits it into domains: `Page`, `DOM`, `Network`, `Input`, `Runtime`, `Emulation`, `Target` and dozens more. Each domain has commands you call and events you receive. Many domains stay silent until the client sends their `enable` command, and from then on the browser does extra work to report what happens in that domain.

There are three versions of the reference. Tip-of-tree follows Chromium's source and changes all the time. The "stable" protocol is a snapshot from Chrome 64. A third covers the V8 inspector that Node.js uses. The documentation is blunt about the first one: CDP "is not a public or supported API for Chrome, and it does not guarantee backwards compatibility". That is the main reason people use Puppeteer or Playwright rather than raw messages, since the library takes on the breakage.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: REST API](https://mosaicbrowser.com/features/rest-api)

## How a client connects

A Chrome that should accept clients has to be started with `--remote-debugging-port=9222`. Since Chrome 136 that switch also needs a non-default `--user-data-dir`, because, as [Google's Chrome blog](https://developer.chrome.com/blog/remote-debugging-port) explains, infostealers had been using the port to pull cookies out of people's everyday profiles. Once it listens, `http://127.0.0.1:9222/json/version` returns the browser's WebSocket address and `/json/list` returns one per tab, worker and frame. Connect to a WebSocket and start sending commands.

The port step by step, with the Playwright and Puppeteer calls and the usual connection failures, is in [connecting to an existing Chrome with CDP](https://mosaicbrowser.com/guides/connect-to-an-existing-chrome-with-cdp).

## What a page can see of it

Most commands leave nothing a page can measure. `Page.navigate` looks like a person typing an address, and `Input.dispatchMouseEvent` arrives as a trusted event. A few commands do leave traces. The [Runtime domain](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/), once enabled, makes the browser serialise what the page logs to its console so it can report it to the client, and a page can build an object whose serialisation runs its own code. Puppeteer and Playwright both enable Runtime when they attach.

We measured this on our own engine in September 2026. Against the public detector deviceandbrowserinfo, `Page.enable`, `Runtime.evaluate` without enabling the domain and `Input.dispatchKeyEvent` all left the verdict at not-a-bot. `Runtime.enable` alone flipped it to `isAutomatedWithCDP`. The mechanism and the rest of that table are in [CDP detection](https://mosaicbrowser.com/glossary/cdp-detection).

## How Mosaic uses CDP

Mosaic starts every profile with its own debugging port. `POST /profiles/:id/start` on the [local REST API](https://mosaicbrowser.com/features/rest-api) returns `debugPort` and `wsEndpoint` for that profile, so ten running profiles are ten separate CDP endpoints, each already carrying its own fingerprint, proxy and cookies. Puppeteer's `browserWSEndpoint` and Playwright's `connectOverCDP` take that address as it is.

![Driving a Mosaic profile from Playwright: start it over the local API and attach to its DevTools socket](https://mosaicbrowser.com/shots/api-automation.png)
*API › Automation shows the Playwright, Puppeteer and raw CDP calls*

Mosaic's own page tools, which the REST API and the MCP server share, drive pages over CDP too, but they never send `Runtime.enable`, and the build fails if that string appears anywhere in the source. They read the page from an isolated world and send clicks and keys through `Input` with human timing. A library you attach yourself is a different matter: Playwright will enable Runtime as it always does, and Mosaic cannot change what it sends. [Using Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser) shows both routes. The API and MCP are part of Pro, $25 a month; automate only accounts and sites whose terms allow it.

## Sources

1. [Chrome DevTools Protocol documentation](https://chromedevtools.github.io/devtools-protocol/), read November 2, 2026
2. [Chrome DevTools Protocol: Runtime domain](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/), read November 2, 2026
3. [Chrome for Developers: Changes to remote debugging switches to improve security](https://developer.chrome.com/blog/remote-debugging-port), read November 2, 2026

## Questions

### Is the Chrome DevTools Protocol a public API?

Not in the supported sense. Its own documentation says CDP is not a public or supported API for Chrome and does not guarantee backwards compatibility. Tools that use it, such as Puppeteer, absorb the changes for you.

### What is the difference between CDP and WebDriver?

WebDriver is a W3C standard that several browsers implement, usually through a separate driver program. CDP is Chromium's own protocol, spoken straight to the browser, and it reaches far more of the browser's internals.

### Which port does the Chrome DevTools Protocol use?

Whichever port you give Chrome with --remote-debugging-port. 9222 is the usual choice in examples. Chrome then serves /json/version and /json/list on that port, and each lists a WebSocket address to connect to.

### Can a website tell that CDP is in use?

Sometimes. Most commands leave no trace a page can read, but enabling the Runtime domain does, and Puppeteer and Playwright enable it when they attach.

## Related

[CDP detection: how a page notices DevTools is driving it](https://mosaicbrowser.com/glossary/cdp-detection): CDP detection is a page noticing that the Chrome DevTools Protocol is driving the browser, usually because Puppeteer or Playwright enabled Runtime.

[How to connect to an existing Chrome with CDP](https://mosaicbrowser.com/guides/connect-to-an-existing-chrome-with-cdp): Connect to an existing Chrome with CDP: launch it with --remote-debugging-port and its own --user-data-dir, read /json/version, then attach a client.

[How to use Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser): Use Playwright with an anti-detect browser by starting the profile first and attaching with connectOverCDP. Keep its context; leave the fingerprint alone.

[Anti-detect browser REST API: profiles from your scripts](https://mosaicbrowser.com/features/rest-api): Mosaic's anti-detect browser REST API runs on 127.0.0.1 with API keys. Create and start profiles, then attach Puppeteer or Playwright over CDP.

[Bot detection: how a site decides a visitor is software](https://mosaicbrowser.com/glossary/bot-detection): Bot detection is how a site scores whether a request comes from a person or from software, using the network, the browser, automation traces and behaviour.





[Selenium detection: the marks ChromeDriver leaves in a page](https://mosaicbrowser.com/glossary/selenium-detection): Selenium detection is how a site spots a browser driven by Selenium: navigator.webdriver, the globals ChromeDriver adds, headless tells, DevTools traces.

[Sannysoft bot test explained, row by row](https://mosaicbrowser.com/guides/sannysoft-bot-test-explained): bot.sannysoft.com checks webdriver, window.chrome, plugins, languages, WebGL and a broken image for signs of a headless browser. What each row tests.

## See chrome DevTools Protocol on a real profile

Mosaic shows the values a site reads, per profile, and runs a leak test from inside the profile’s own page. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
