# How to detect headless Chrome

> How to detect headless Chrome: it names itself in its User-Agent, drops the real GPU and is usually driven over DevTools. The checks that hold up.

Source: https://mosaicbrowser.com/guides/detect-headless-chrome

## How to detect headless Chrome: the signals that hold up

To detect headless Chrome, check the User-Agent for the HeadlessChrome token, navigator.webdriver for true, and the WebGL renderer for a software rasteriser instead of a real GPU, then look for a DevTools client such as an enabled Runtime domain. Treat each as evidence, not proof, and repeat timing checks.

![Headed versus Headless, each name in its own tile: What changes when Chrome runs headless](https://mosaicbrowser.com/covers/detect-headless-chrome.webp)

You detect headless Chrome by what it says about itself and by what it cannot fake cheaply. The strongest single signal is the User-Agent: by default it contains `HeadlessChrome`. After that come `navigator.webdriver`, a graphics renderer that is software rather than a real chip, and the marks a DevTools client leaves on the page. None is proof on its own. Together, and repeated, they are good evidence.

We run into this from the other side. Mosaic drives real browser profiles for warm-up and for measurements, and we learned which of these signals fire by tripping them.

## Signal 1: the HeadlessChrome token

Measured on a stock Chrome 152 with no other flags:

```
headed    Mozilla/5.0 (…) Chrome/152.0.0.0 Safari/537.36
headless  Mozilla/5.0 (…) HeadlessChrome/152.0.0.0 Safari/537.36

```

The check is one line, on the server or in the page:

```
const headlessUA = /HeadlessChrome/.test(navigator.userAgent)

```

It catches every headless Chrome that did not bother to change its string, and that is more of them than you would expect. Our own warm-up robot ran headless by default for a while, and the profiles it used had their User-Agent set to the engine's own string, so our launcher skipped the override. Those were the best-configured profiles we had, and every site they visited was told `HeadlessChrome`.

A browser that does override the string pays elsewhere. Passing `--user-agent` empties Chrome's high-entropy client hints: in our measurement `architecture` went from `"arm"` to `""`. ([What a User-Agent override breaks](https://mosaicbrowser.com/guides/change-user-agent-in-chrome) has the table.) So compare the string with `navigator.userAgentData.getHighEntropyValues(['architecture', 'platformVersion'])`. Blank values beside a Chrome User-Agent are not something a normal Chrome produces.

## Signal 2: navigator.webdriver

`navigator.webdriver` "indicates whether the user agent is controlled by automation" ([MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver)). It is true in Chrome started for WebDriver and by most automation launchers.

```
const automated = navigator.webdriver === true

```

It answers a different question from the one in the title. A headed Chrome under Selenium sets it; a headless Chrome launched by hand may not. Read it as "automated", not "headless".

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Fingerprints set inside the browser](https://mosaicbrowser.com/features/engine)

## Signal 3: no real graphics chip

Headless Chrome drops the real GPU. A page can ask WebGL which renderer it got:

```
const gl = document.createElement('canvas').getContext('webgl')
const ext = gl && gl.getExtension('WEBGL_debug_renderer_info')
const renderer = ext ? gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) : null

```

A renderer that names a software rasteriser instead of the chip a matching desktop would have is a strong hint, and the more useful check is consistency: a Mac User-Agent with a renderer no Mac has. This is also the signal with the most false positives, because virtual machines and some remote desktops have no GPU either.

One detail if you write this check yourself: until the page has called `getExtension('WEBGL_debug_renderer_info')`, the unmasked parameters answer `null` with an `INVALID_ENUM` error in a real browser. A spoof that answers them on a fresh context has contradicted Chrome before you read the value.

## Signal 4: a DevTools client on the page

Headless Chrome is nearly always driven over the DevTools Protocol, and some of what a client does is visible. The best-known case is `Runtime.enable`. The detector at [deviceandbrowserinfo.com](https://deviceandbrowserinfo.com/are_you_a_bot) reports it as `isAutomatedWithCDP`. We measured it one fresh profile per row:

| Sent by the client | Verdict |
| --- | --- |
| `Runtime.enable` | isBot=true (`isAutomatedWithCDP`, `hasInconsistentTimingResolution`) |
| `Page.enable` | isBot=false |
| `Runtime.evaluate` without enabling the domain | isBot=false |
| an isolated world plus evaluate | isBot=false |
| `Input.dispatchKeyEvent` | isBot=false |

Playwright enables `Runtime`, so this catches the common stack, headed or not.

There is a caution here for anyone writing detection. When we later used `Runtime.enable` as a deliberate positive control, it fired in only two of four consecutive runs. The flag that carried it, `hasInconsistentTimingResolution`, is a timing measurement and depends on machine load. A timing-based check needs several samples before it means anything.

## Old headless is a different browser

Google's documentation says Chrome "now has unified Headless and headful modes", and that since Chrome 132.0.6793.0 the old Headless mode "is only available as a standalone binary named chrome-headless-shell" ([Chrome Headless mode](https://developer.chrome.com/docs/chromium/headless)). The old implementation did not share the full browser's code, so it differs from Chrome in more places. If a request looks like Chrome in its string and like nothing else everywhere else, it may be that shell.

## Putting the checks together

| Signal | Cost to check | What it proves | False positives |
| --- | --- | --- | --- |
| `HeadlessChrome` in the User-Agent | One regex | Headless, and nobody hid it | None in practice |
| Blank high-entropy client hints beside a Chrome string | One async call | The string was overridden | Low |
| `navigator.webdriver === true` | One property | Automation, headed or not | Low |
| Software renderer, or one the claimed OS cannot have | WebGL query | No real GPU, or a spoofed one | VMs, remote desktops |
| CDP `Runtime` enabled | A detector-side script | A DevTools client attached | Possibly people with DevTools open |

Score them rather than blocking on one, and repeat anything based on timing. Public test pages that bundle these checks, such as [bot.sannysoft.com](https://mosaicbrowser.com/guides/sannysoft-bot-test-explained), are a quick way to see your own detector's view of a browser you control.

## Why Mosaic does not measure headless

Our rule is that a measurement never runs headless, because a headless Chrome grades a browser we do not ship: different User-Agent, no real GPU. Background work in Mosaic runs in a headed browser parked off-screen, with the same renderer and the same User-Agent the profile uses everywhere else. Headless is still there for anyone who asks for it, as Start headless in a profile's menu or through the API, and then the launcher always passes the profile's own User-Agent so the token cannot leak, accepting the emptied client hints as the lesser tell.

Pages are driven without enabling `Runtime`; queries run in an isolated world, and clicks and keys go through real input events. If you drive a profile with your own tools, [attaching over CDP](https://mosaicbrowser.com/guides/connect-to-an-existing-chrome-with-cdp) explains what the connection does and does not show a page. The values a profile reports are set inside [Tesseract Chrome](https://mosaicbrowser.com/features/engine), inside the engine.

## Sources

1. [Chrome for Developers: Chrome Headless mode](https://developer.chrome.com/docs/chromium/headless), read November 2, 2026
2. [MDN: Navigator.webdriver](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver), read November 2, 2026
3. [deviceandbrowserinfo: Are you a bot?](https://deviceandbrowserinfo.com/are_you_a_bot), read November 2, 2026

## Questions

### Can headless Chrome hide the HeadlessChrome token?

Yes, by passing its own User-Agent. That is why the token is only the cheapest check. A browser that does so often gives itself away elsewhere, for example with empty high-entropy client hints, which the override causes.

### Is navigator.webdriver enough to detect headless Chrome?

No. It reports automation, not headlessness: a headed browser under WebDriver sets it, and some automation set-ups clear it. Use it alongside the other checks.

### What is the difference between old and new headless?

New headless is the normal Chrome browser run without a window. The old implementation was separate code; since Chrome 132.0.6793.0 Google ships it only as a standalone binary called chrome-headless-shell.

### Will blocking headless Chrome block real users?

Rarely on the token, which real users do not send. More often on fuzzy signals such as a software renderer, which also appears on some virtual machines and remote desktops. Score them; do not block on one.

## Related

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

[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 change the user agent in Chrome, and what it breaks](https://mosaicbrowser.com/guides/change-user-agent-in-chrome): How to change the user agent in Chrome with DevTools, a launch flag or an extension, and why none of them changes the client hints to match.

[Cloudflare Turnstile keeps looping: why, and what to check](https://mosaicbrowser.com/guides/cloudflare-turnstile-keeps-looping): Cloudflare Turnstile keeps looping when its check fails and retries. Its error codes name the causes: clock, blocked frame, extensions, network, bots.

[An anti-detect browser with its own Chromium engine](https://mosaicbrowser.com/features/engine): Mosaic is an anti-detect browser with its own Chromium engine, Tesseract Chrome: stock Chromium source, with fingerprint values changed inside the engine.

[How does Cloudflare bot management work?](https://mosaicbrowser.com/guides/how-does-cloudflare-bot-management-work): A Cloudflare bot score of 1 is automated, 2 to 29 likely automated, 30 to 99 likely human, 0 not scored. Heuristics, a model and a JS check set it.

[How do sites detect anti-detect browsers?](https://mosaicbrowser.com/guides/how-do-sites-detect-anti-detect-browsers): Sites detect anti-detect browsers by contradictions: a page and its workers disagreeing, a GPU name the driver does not match, fonts from another OS.



## Run this guide on your own accounts

Every Mosaic profile is a fingerprint, a proxy IP and a cookie jar that agree with each other, kept on your computer. 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.
