DEV Community

Cover image for Why headless Chrome gets flagged, and what we changed in our own browser
Browsa
Browsa

Posted on Edited on

Why headless Chrome gets flagged, and what we changed in our own browser

Disclosure: I work on Browsa. Phantom is the browser we build for it.

If you've pointed an AI agent at a real website from a server, you've seen it: a page that works in your own browser shows the agent a challenge, an empty shell or a 403. Usually the site isn't reacting to what the agent does. It's reacting to what the browser says about itself before the agent has done anything.

What stock headless Chromium reports

I ran the same eight-line probe in two browsers on 24 November 2026: Playwright's stock headless Chromium on my laptop, and a Phantom browser in Browsa's cloud.

() => {
  const gl = document.createElement('canvas').getContext('webgl');
  const dbg = gl && gl.getExtension('WEBGL_debug_renderer_info');
  return {
    headless_in_user_agent: navigator.userAgent.includes('HeadlessChrome'),
    webdriver: navigator.webdriver,
    plugins: navigator.plugins.length,
    languages: navigator.languages.join(','),
    window_chrome: typeof window.chrome === 'object',
    webgl_renderer: dbg ? gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) : null,
    screen: screen.width + 'x' + screen.height,
    outer_window: outerWidth + 'x' + outerHeight,
  };
}
Enter fullscreen mode Exit fullscreen mode
Stock headless Chromium Phantom
HeadlessChrome in the user agent yes no
navigator.webdriver true false
navigator.plugins.length 0 5
navigator.languages en-US en-US,en
window.chrome exists no yes
WebGL renderer SwiftShader (Google's software GPU) ANGLE Metal Renderer: Apple M4
Screen 1280x720 1710x1107
Outer window 1280x720, same as the screen 1710x1075, smaller than the screen as on a desktop

Every bold cell is something a site can read in one line of JavaScript, and none of them shows up on a person's laptop. The user agent alone gives it away. Sites don't need clever fingerprinting to spot stock headless Chromium.

Why patching it from the outside goes wrong

The common fix is a stealth plugin: a script injected into every page that overwrites navigator.webdriver, fakes plugins and so on. Two problems:

  1. The patch is visible. An overwritten getter isn't the same as a native one. A function's toString(), a property descriptor or the order of properties can show that something was changed.
  2. Values stop agreeing with each other. Change the user agent to Mac and leave a SwiftShader GPU, a Linux font list and a 1280x720 screen, and the browser is now inconsistent. Inconsistent is a stronger signal than headless.

What we did instead

Phantom makes these changes inside the browser build, so no script is injected into pages. And it picks the machine as one set: when the browser claims to be a Mac, cores, memory, screen, GPU name, fonts and voices all come from that same Mac profile.

Where it still falls short

This is the part most "undetectable browser" posts leave out. From our own measurements (browsa.io/phantom):

  • Drawing runs in software. The GPU name is right, but a shader draw test took 716 ms in Phantom against 108 ms on a real Mac, and the image it drew is different. A site that times drawing can tell.
  • Fonts: all 37 macOS fonts our probe looks for are present, but text in system-ui measures about 890 px against 827 px on the real Mac.
  • Media: no Widevine and no HEVC. A real Chrome on a Mac has both.
  • CreepJS: 0% headless and 0% stealth, but 31% "like headless", with two WebGL notes.

We publish dated results, misses included, at browsa.io/benchmarks.

What this means for your agent

  • If your agent runs stock headless Chromium on a server, expect the challenges you see. They aren't bad luck.
  • A browser that's consistent with itself beats one that's patched in places.
  • And none of this makes it fine to automate a site whose terms say no. It's about ordinary agent work, like reading a page or filling in a form you're allowed to fill, not breaking because of how the browser was built.

Try the probe yourself: an earlier post in this series connects Playwright to a Phantom browser in one line. 100 free credits at browsa.io.

Top comments (0)