# What is CDP detection?

> CDP detection is a page noticing that the Chrome DevTools Protocol is driving the browser, usually because Puppeteer or Playwright enabled Runtime.

Source: https://mosaicbrowser.com/glossary/cdp-detection

## CDP detection: how a page notices DevTools is driving it

CDP detection is a web page working out that the browser is being controlled through the Chrome DevTools Protocol, the interface Puppeteer and Playwright use. The best-known check catches the Runtime domain being enabled, which makes the browser do work a few lines of page JavaScript can observe.

![CDP detection, drawn as a mosaic of tiles](https://mosaicbrowser.com/covers/cdp-detection.webp)

The Chrome DevTools Protocol, CDP, is how anything outside a Chromium browser drives it: the DevTools window, Puppeteer, Playwright, and every tool built on them. A client connects to a socket, enables the domains it wants (Page, Network, Runtime and so on) and sends commands. The page is not supposed to know. CDP detection is the page finding out anyway, and it is one of the checks [bot detection](https://mosaicbrowser.com/glossary/bot-detection) uses to separate an automated Chrome from a person's, even when the fingerprint is clean and `navigator.webdriver` is false.

## How CDP detection works

The [Runtime domain](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/) gives a client JavaScript execution and console events. Once a client enables it, the browser starts reporting what happens in the page's console to that client, and to report a logged object it has to read the object. A page can log an object built so that reading it runs the page's own code. With no client listening, nothing reads it and nothing runs. With Runtime enabled, the code runs, and the page has its answer. The rebrowser project describes it as "a few lines of JavaScript on the page that are automatically called if Runtime.Enable was used" ([`rebrowser-patches`](https://github.com/rebrowser/rebrowser-patches), read 2 November 2026).

Puppeteer and Playwright both enable Runtime when they attach, because they use it to track the page's execution contexts. So does the DevTools window you open by hand. Other checks look at timing: the protocol's work shows up as small, uneven delays a page can measure.

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)

## What we measured

We build our page-driving tools on CDP, so we tested which commands a page can see. One fresh profile per row, against the public detector deviceandbrowserinfo, as recorded in our engineering notes:

| Command | Verdict |
| --- | --- |
| `Page.enable` | not a bot |
| `Runtime.evaluate`, without enabling the domain | not a bot |
| An isolated world plus evaluate | not a bot |
| `Input.dispatchKeyEvent` | not a bot |
| `Runtime.enable` | bot (`isAutomatedWithCDP`) |

A later run added `DOM.enable`, `Accessibility.getFullAXTree`, `Log.enable` and `Network.enable`, all clean, and kept `Runtime.enable` as a deliberate positive control. The control fired in two of four consecutive runs, flagged as `hasInconsistentTimingResolution`, which is a timing check and therefore depends on load. So the signal is real, and one clean reading does not prove its absence.

We had shipped `Runtime.enable` in five places before that, warm-up and typing among them, each for no reason. A profile was clean at launch and detectable the moment anything drove it.

## How Mosaic handles CDP detection

Mosaic's own page tools, on the [REST API](https://mosaicbrowser.com/features/rest-api) and over MCP, never enable Runtime. They read and act from an isolated world the page's scripts cannot see, and send clicks and keys as trusted input with human timing. The build fails if `Runtime.enable` appears anywhere in the source. One cost is stated where it applies: reading a page's uncaught errors needs a hook in the page's own world, so that switch is off by default and its reply says it is detectable.

![The Mosaic MCP server: let an AI assistant manage profiles, proxies and launches](https://mosaicbrowser.com/shots/settings-mcp.png)
*The MCP server drives pages without enabling Runtime*

Starting a profile over the API also returns a DevTools endpoint, and Puppeteer or Playwright can attach to it. Then the client is yours, and Playwright enables Runtime as it always does; Mosaic cannot change what an attached library sends. [Using Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser) shows both routes side by side, and [connecting to an existing Chrome with CDP](https://mosaicbrowser.com/guides/connect-to-an-existing-chrome-with-cdp) covers the protocol from the other end. Automate only accounts and sites whose terms allow it.

## Sources

1. [Chrome DevTools Protocol: Runtime domain](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/), read November 2, 2026
2. [rebrowser-patches: Runtime.Enable leak (GitHub)](https://github.com/rebrowser/rebrowser-patches), read November 2, 2026

## Questions

### Does Playwright get detected by CDP detection?

It can. Playwright enables the Runtime domain on the pages it attaches to, and that is the call the best-known check catches. In our tests it flipped one public detector to a bot verdict.

### Is navigator.webdriver the same as CDP detection?

No. navigator.webdriver is a flag the browser sets when it runs under automation. CDP detection reads side effects of the DevTools protocol itself, so a browser with the flag false can still be caught.

### Does opening DevTools by hand trigger CDP detection?

It can. The DevTools window is itself a CDP client and enables Runtime to run its console, so a page that checks for it may react when you open DevTools on it.

### Can a page see every CDP command?

No. Most commands leave nothing a page can read. Detection works on the few that cause visible side effects, which is why it focuses on Runtime and on timing.

## Related

[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.

[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.

[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.

[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.

[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.

[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.

[navigator.webdriver: the flag that says automation is driving](https://mosaicbrowser.com/glossary/navigator-webdriver): navigator.webdriver is a browser property that reads true when automation controls the browser. Chrome sets it for --enable-automation and --headless.



[How to use Puppeteer with an anti-detect browser](https://mosaicbrowser.com/guides/use-puppeteer-with-an-anti-detect-browser): Use Puppeteer with an anti-detect browser through puppeteer.connect: start the profile, pass its wsEndpoint, set defaultViewport to null, then disconnect.

## See CDP detection 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.
