Glossary
Headless browser detection: how sites notice no window
Headless browser detection is the set of checks that reveal a browser running without a visible window, the mode most automation and testing tools use by default.
Definition
A headless browser is a full browser engine that runs without drawing a window. It loads pages, executes JavaScript and handles cookies like any other browser, which makes it ideal for testing and data collection. Because it is the standard engine underneath, the differences are small, but they exist, and detection scripts know where to look.
Classic traces
| Check | What a headless run may show |
|---|---|
navigator.webdriver | true when the browser is under automation control |
| User-Agent | A HeadlessChrome token in older headless modes |
| Plugins and MIME types | Empty lists where desktop Chrome reports a PDF viewer |
| Window metrics | Outer size equal to inner size, or a default such as 800 by 600 |
| Permissions | Notification permission states that contradict each other |
| Graphics | A software renderer in WebGL output |
| Languages | An empty or single value list where browsers send several |
Not every item applies to every version. Chrome's newer headless mode shares far more code with the regular browser, and several of these traces are gone in it. Check the current behavior of the version you run.
Deeper signals
Modern detection goes beyond single properties.
- Automation protocol side effects: some frameworks inject helper functions or bindings that a script can find, and DevTools protocol usage can leave timing patterns. See CDP.
- Rendering: canvas and WebGL output from a server without a GPU.
- Behavior: no mouse movement before a click, instant typing, scrolling in exact steps.
- Consistency: a Windows User-Agent with Linux fonts, or a time zone that does not match the IP.
Why sites check at all
Headless mode is how most scrapers and scripted abuse run, so it is an efficient filter. It is also cheap: a handful of property reads cost the site almost nothing compared with a full behavior model, so these checks usually run first and decide whether the heavier analysis is needed. It also catches legitimate tests, which is why many site owners whitelist their own QA traffic by header or address rather than weakening detection.
Handling it in test and data jobs
Prefer the newer headless mode or headed runs
Running the browser headed under a virtual display, or using the newer headless mode, removes many classic traces without patching anything.
Set realistic launch options
Give the browser a common viewport, real locale and time zone values that match the proxy region, and do not disable features a normal user has.
Avoid partial patches
Overriding one property while leaving related ones untouched produces new contradictions. A single fix to navigator.webdriver is the usual example.
Measure before and after
Keep a small page on a server you control that prints the values listed above. Load it with each new browser version or launch option, and you will see immediately which traces a change removed and which it introduced.
When a challenge still appears
Even a carefully set up browser meets widgets on sensitive pages. Rather than clicking through image grids in a headless session, send the widget parameters to a solver. GateSolver returns a token for reCAPTCHA v2, reCAPTCHA v3 or Cloudflare Turnstile, which your script injects into the page before submitting the form. Billing happens only when an answer comes back. The token is valid for a short window, so request it close to the moment you submit. Framework specific steps are in the Playwright detection guide and the Playwright integration.
Common questions
Is headless Chrome always detectable?
Not always, especially in the newer headless mode, but small differences in rendering, behavior and automation flags often remain.
Does running headed remove all detection risk?
No. Headed mode removes some traces, but automation flags, IP reputation and behavior still count.
Why does my test pass locally but fail in CI?
CI machines usually lack a GPU and use datacenter addresses, so rendering and network signals look different from your laptop.
Can I solve a CAPTCHA inside a headless browser?
Yes. Send the widget parameters to a solver task, then inject the returned token into the page from your script.
Should I patch every property I can find?
Patch carefully or not at all; inconsistent patches are easier to detect than a clean, unmodified browser.
Keep reading
- Headless browserA real browser engine running without a visible window, driven by code for tests, screenshots and pages that need JavaScript.
- navigator.webdriverThe standard flag that reports automation control, what switches it on, and why overriding it alone fixes little.
- Why your Playwright bot is detectedThe automation tells a stock Playwright launch exposes, how sites read them, and practical changes for calmer test runs.
- PlaywrightPlaywright in Node.js and Python: read widget keys from the DOM or network, inject tokens, and add answers through route interception.