Dev.to Security 🔐 Cybersecurity 👁 0 📖 6 min read

How to Detect Headless Chrome: Why One Signal Is Never Enough

Since Chrome 112, headless Chrome is the ordinary browser with its window left out, and since Chrome 132 the older, separate headless implementation exists only as a standalone download called chrome-headless-shell. That

Since Chrome 112, headless Chrome is the ordinary browser with its window left out, and since Chrome 132 the older, separate headless implementation exists only as a standalone download called chrome-headless-shell. That changes how to detect headless Chrome. The browser is the real one, so what a site can read is mostly settings and surroundings, and the useful question is whether everything a client says about itself, in every layer the site can see, tells the same story.

One signal is a claim, and whoever launches the browser can edit a claim. Two layers that disagree are evidence.

How to detect headless Chrome: five layers a site can check

Each layer is written by different software, which is why the layers can disagree.

Layer What a site reads What a headless Chrome shows On its own
HTTP headers User-Agent, Client Hints (brand list, platform) HeadlessChrome in the default User-Agent Weak: the launcher can set both
TLS and TCP The handshake, the first packets A Chrome handshake on the host's network stack Strong against scripts with no browser, silent on a real Chrome
JavaScript navigator.webdriver, plugins, built-in functions The flag is true under default launch switches One boolean, set by the launcher
Graphics and screen WebGL renderer, screen and window size, cores, memory A software WebGL renderer and a small default screen on a GPU-less server Moderate: not every machine without a GPU is a bot
Time and behavior Time zone against IP location, request pace, pointer and keyboard activity The host's time zone, input at the pace the script sets Weak per request, informative over a session

Vendors describe the same split. Cloudflare's bot detection pairs heuristics on every request with a JavaScript engine aimed at headless browsers and a machine-learning model fed with headers, session traits and browser signals. Turnstile's small JavaScript challenges probe web APIs, browser quirks and human behavior. reCAPTCHA collects signals once the page initializes its script and returns a score with reason codes such as AUTOMATION and UNEXPECTED_ENVIRONMENT.

Headless Chrome user agent and navigator.webdriver: why one signal fails

Chromium puts HeadlessChrome into the User-Agent when the headless switch is on, and navigator.webdriver turns true under the automation and headless switches. Both are announcements by the launcher, so the launcher decides what they say. Chrome's DevTools protocol, one of the channels automation tools use, has emulation commands for the User-Agent (with its Client Hints data as a separate parameter), the time zone and the locale. The flag exists so that cooperating browsers can tell a page that automation is in control, which means it catches the setups that cooperate.

The User-Agent also says less than it used to. Since User-Agent reduction, Chrome reports the same operating system version whatever the machine runs: Windows NT 10.0 on Windows, 10_15_7 on macOS. Anything finer comes from Client Hints, which exist only on HTTPS and go beyond the basic three only when the site asks.

What headless Chrome reports from a server

One headless Chrome 145 on a Linux server, run through the Privacy & Trust Index scan on 19 November 2026, reported:

  • a User-Agent with HeadlessChrome/145 and navigator.webdriver set to true
  • Client Hints that list Chromium and a placeholder brand but not Google Chrome, with the platform Linux
  • a WebGL renderer called SwiftShader, which is a software renderer, and an 800 by 600 screen, Chromium's headless default
  • a populated plugin list (five PDF viewer entries) and a window.chrome object

The page's Integrity & Anti-Spoof group asks whether the browser is actually what it claims to be. For this run, Device Integrity read Bot detected ("The browser is being driven by automation software."), Tamper Detection read Genuine, the TLS card read Consistent, the TCP/OS card read OS match, and Regional Integrity read Timezone mismatch ("Your device clock points to a different region than your IP.").

One card is red, and it reads the flag. The browser made no false claim, so its User-Agent, Client Hints, handshake and TCP packets all describe the same Linux Chrome. The time zone card shows the other kind of finding, a clock set to one country's zone behind an address in another, which is what a check for a client that lies about itself looks for.

Bot detection techniques: agreement between layers beats any flag

The browser build and the launcher write the User-Agent and the Client Hints, the engine writes the JavaScript values, the TLS library writes the handshake, the operating system writes the TCP packets, and the network decides where the IP address is located. An edit in one place does not move the others. Typical disagreements:

  • A User-Agent that claims Windows next to Client Hints that say Linux.
  • Chrome in the User-Agent but a handshake from an HTTP library, or Windows in the User-Agent but TCP packets from a Linux kernel.
  • A claimed desktop with a software graphics renderer. Chrome is retiring the automatic software WebGL fallback and keeps an opt-in for headless and GPU-less test machines.
  • A browser time zone in one country and an IP address in another.

The guide to how sites catch user agent spoofing walks through the User-Agent, Client Hints, navigator.platform and touch-point comparisons, including the differences that User-Agent reduction introduces deliberately and a sound check leaves alone. Browsers rebuilt to present many identities at once, the anti-detect kind, are a harder case with signals of their own, which the guide to fake browser detection covers.

Why Playwright, Puppeteer and Selenium runs get challenged

A test suite meets the same checks as a scraper, whatever its intent.

  1. The defaults are loud. Puppeteer and ChromeDriver start Chrome with the automation switch, so navigator.webdriver is true in a stock test run.
  2. The default headless browser may not be the one your users run. Playwright's default headless mode is a separate lightweight build, chromium headless shell, while headed runs use full Chromium. Puppeteer's default is Chrome itself in headless mode, with the shell as an option.
  3. The machine is a server. The scan above labeled that run's connection as coming from a datacenter, and the other server traits from the table come with it.
  4. The session is brand new: a fresh profile with no history or cookies, input at machine speed, hundreds of runs from one address.
  5. The site's bot defense sits in the test path. Turnstile lists Selenium, Cypress and Playwright among the clients it detects. Turnstile, reCAPTCHA and hCaptcha each offer a sanctioned route for tests: Turnstile dummy keys, a separate reCAPTCHA key for test environments plus v2 test keys that always pass, and hCaptcha keys that pass every check and provide no anti-bot protection.

A failing test is fixed by taking the third-party check out of the test, through those keys or an environment where the check is off, not by making the browser look more human. A suite that has to pass a production check is testing someone else's bot defense, and only that site's owner can grant an exception.

False positives: what site owners should do

  • Treat each layer as a vote. Cloudflare's JavaScript detections are meant to feed a managed challenge, because a real visitor can fail them through network problems, an ad blocker, disabled JavaScript or a native app. reCAPTCHA recommends acting in the background, for example by asking for a second factor on a low score, instead of blocking.
  • Expect honest oddities. Tor Browser reports uniform screen and window sizes, Brave reports generic GPU strings, many virtual machines have no usable GPU, and travelers and VPN users have a time zone that differs from their address. A check that expects pointer movement has nothing to read from a keyboard-only or screen-reader user.
  • Remember real hardware that breaks a rule. Linux on Apple silicon runs on a real Apple GPU. Users of Asahi Linux reported being blocked at a large payments site's security challenge, and the suspected trigger was an Apple GPU string next to a Linux claim. A rule that calls that pairing impossible is wrong about real machines.
  • Count the cost of puzzles. A puzzle in front of a login is a cognitive test, and WCAG 2.2 level AA wants an alternative path for such tests.
  • Let the automation you trust identify itself. Signed requests give you something firmer than a User-Agent to allowlist.
📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.