Your TLS handshake now passes. The last article in this series fixed that layer — JA4 impersonation gets your scraper a 200 where python-requests got a 403. And yet the target still bans the session within an hour. This article is about the layer above TLS: JavaScript execution signals — everything a page’s script can learn about your browser once it’s running inside it. We drove real Chrome over the raw DevTools Protocol (no Playwright, no stealth plugin, every CDP frame explicit), measured which signals each launch mode leaks, killed the folklore that doesn’t hold in 2026, and found a hole in the most common evasion approach that we have not seen documented anywhere: user-agent overrides don’t reach cross-origin iframes, and the frames quietly report the real headless UA to whoever’s listening.

The stakes are concrete. Imperva counted automated traffic at 51% of all web traffic in 2024 — the first time bots overtook humans — and more than 53% in 2025. The industry’s response is priced accordingly: Oxylabs’ residential proxies run $6/GB at low volume down to $2.50/GB at a terabyte per month, and managed “unblocker” APIs multiply per-request costs by up to 75 credits per page. Whether that bill is $40/month or $4,000/month depends almost entirely on how many of the signals below your stack emits.

The test bench

Three launch modes of Chrome for Testing 156 on a headless Linux server, all driven identically over CDP:

  1. chrome-headless-shell — the binary automation tooling downloads for “old-style” headless (the mode Google removed from mainline Chrome in 132, but which survives as this separate binary),
  2. full Chrome with --headless=new — the real browser, no window,
  3. full Chrome --headless=new with a truthful-looking --user-agent flag — the lazy fix most tutorials suggest.

The probe navigates to a real HTTPS page (secure context — this matters, because navigator.userAgentData is gated to it), then reads two dozen signals in-page. Full script, tested to exit 0 (every code block in this article ran on the day of publication):

# probe_core.py — drive Chrome over raw CDP, snapshot every JS-layer
# bot signal per launch profile. Ran on Chrome for Testing 156, exit 0.
import asyncio, json, subprocess, urllib.request
import websockets

CHROME_FULL = "/home/ubuntu/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome"
CHROME_HSS  = ("/home/ubuntu/.cache/ms-playwright/chromium_headless_shell-1248/"
               "chrome-headless-shell-linux64/chrome-headless-shell")
PORT = 9333

PROBE_JS = """
() => {
  const r = {};
  r.webdriver = navigator.webdriver;
  r.ua = navigator.userAgent;
  r.headlessInUA = /HeadlessChrome/.test(navigator.userAgent);
  r.plugins = navigator.plugins.length;
  r.chromeObj = !!window.chrome;
  // headless-shell strips Document.prototype methods; real Chrome keeps them
  const docProps = Object.getOwnPropertyNames(Document.prototype);
  r.docProtoOwn = ['getElementById','querySelector','createEvent','fullscreenEnabled']
      .map(p => docProps.includes(p));
  r.webglVendor = null; r.webglRenderer = null;
  try {
    const gl = document.createElement('canvas').getContext('webgl');
    if (gl) {
      const dbg = gl.getExtension('WEBGL_debug_renderer_info');
      r.webglVendor   = gl.getParameter(dbg ? dbg.UNMASKED_VENDOR_WEBGL : gl.VENDOR);
      r.webglRenderer = gl.getParameter(dbg ? dbg.UNMASKED_RENDERER_WEBGL : gl.RENDERER);
    }
  } catch (e) { r.webglRenderer = 'ERR:' + e.message; }
  r.userAgentData = navigator.userAgentData ?     // UA-CH: only in secure contexts
      {mobile: navigator.userAgentData.mobile,
       platform: navigator.userAgentData.platform,
       brands: navigator.userAgentData.brands.map(b => b.brand)} : null;
  return r;
}
"""

async def cdp_call(ws, method, params=None, _id=[0]):
    _id[0] += 1
    await ws.send(json.dumps({"id": _id[0], "method": method, "params": params or {}}))
    while True:
        msg = json.loads(await ws.recv())
        if msg.get("id") == _id[0]:
            if "error" in msg:
                raise RuntimeError(f"{method}: {msg['error']}")
            return msg["result"]

async def run_profile(name, binary, flags):
    proc = subprocess.Popen(
        [binary, "--no-sandbox", "--disable-gpu", "--no-first-run",
         f"--remote-debugging-port={PORT}", "--remote-debugging-address=127.0.0.1",
         "https://example.com/"] + flags,
        stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
    try:
        ws_url = None
        for _ in range(50):                       # wait for the page target
            try:
                tabs = json.loads(urllib.request.urlopen(
                    f"http://127.0.0.1:{PORT}/json/list", timeout=1).read())
                page_tabs = [t for t in tabs if t.get("type") == "page"]
                if page_tabs:
                    ws_url = page_tabs[0]["webSocketDebuggerUrl"]
                    break
            except Exception:
                await asyncio.sleep(0.15)
        assert ws_url, "DevTools page target never came up"
        async with websockets.connect(ws_url, max_size=50*1024*1024) as ws:
            await cdp_call(ws, "Page.enable")
            await cdp_call(ws, "Runtime.enable")  # detector bait, on purpose
            await asyncio.sleep(0.8)
            res = await cdp_call(ws, "Runtime.evaluate",
                                 {"expression": f"({PROBE_JS})()",
                                  "returnByValue": True})
            snap = res["result"]["value"]
            snap["profile"] = name
            return snap
    finally:
        proc.terminate()
        proc.wait()

One honest caveat before the results: Runtime.enable — which DataDome-class vendors flag on the CDP wire — is enabled on purpose here, because the article’s question is what the page can see, not what the socket leaks. Wire-level CDP detection is a separate arms race (Runtime.enable domain events, distinctive console patterns); treat it as an additional layer, not a substitute.

The results: two binaries, two different lies

Scoring is a weighted detector — each hit costs points reflecting roughly how expensive it is for an evasion stack to fake:

# detector.py — score profiles against a JS-layer bot detector. Exit 0.
import json, sys

def score(snap):
    hits = []
    if snap.get("webdriver") is True:
        hits.append(("navigator.webdriver === true", 40))
    if snap.get("headlessInUA"):
        hits.append(("HeadlessChrome in User-Agent", 15))
    if snap.get("plugins", 0) == 0:
        hits.append(("navigator.plugins empty", 15))
    if not snap.get("chromeObj"):
        hits.append(("window.chrome missing", 10))
    if snap.get("docProtoOwn") is not None and not all(snap["docProtoOwn"]):
        hits.append(("Document.prototype stripped (headless-shell tell)", 25))
    wr = snap.get("webglRenderer") or ""
    if "SwiftShader" in wr or "llvmpipe" in wr:
        hits.append(("SwiftShader/llvmpipe GPU in WebGL renderer", 20))
    if snap.get("outerW", 0) == 0 or snap.get("outerH", 0) == 0:
        hits.append(("outerWidth/outerHeight == 0", 10))
    uach = snap.get("userAgentData")
    if isinstance(uach, dict) and any("Headless" in b for b in uach.get("brands") or []):
        hits.append(("HeadlessChrome brand in userAgentData "
                     "(UA-CH leaks even with a patched UA string)", 30))
    elif uach is None:
        hits.append(("navigator.userAgentData absent", 10))  # headless-shell tell
    return {"profile": snap.get("profile"), "score": min(sum(w for _, w in hits), 100),
            "hits": [h for h, _ in hits]}

rows = json.load(open(sys.argv[1]))
scored = sorted((score(r) for r in rows if "error" not in r),
                key=lambda s: s["score"], reverse=True)
for s in scored:
    print(f'{s["score"]:3d}  {"#" * (s["score"] // 5):<20}  {s["profile"]}')
    for h in s["hits"]:
        print(f'      - {h}')
assert scored[0]["score"] > 50, "old headless-shell must flag hot"
assert all(s["score"] < 70 for s in scored if "shell" not in s["profile"])
print("DETECTOR OK"); sys.exit(0)

Live output, straight from the run:

100  ####################  headless-shell (old-style)
      - navigator.webdriver === true
      - HeadlessChrome in User-Agent
      - navigator.plugins empty
      - window.chrome missing
      - SwiftShader/llvmpipe GPU in WebGL renderer
      - HeadlessChrome brand in userAgentData (UA-CH leaks even with a patched UA string)
 35  #######               full chrome --headless=new
      - HeadlessChrome in User-Agent
      - SwiftShader/llvmpipe GPU in WebGL renderer
 20  ####                  full chrome --headless=new + real UA flag
      - SwiftShader/llvmpipe GPU in WebGL renderer

Read this table correctly and three decisions fall out of it.

Decision 1: chrome-headless-shell is dead for anything protected. Score 100 — every signal fires at once: navigator.webdriver === true, an empty plugin array, no window.chrome, a Document.prototype missing methods that a decade of detection scripts probes for, and a UA-CH brand list that literally contains HeadlessChrome. This is the binary that puppeteer downloads by default on many CI images, and it is trivially detectable before any override applies. If your stack starts here, every downstream fix is cosmetic.

Decision 2: the 2023-era panic about --headless=new being “ruined” is outdated. The measured reality on Chrome 156 is the opposite of the folklore: --headless=new gives you a browser whose navigator.webdriver is false with zero patches, navigator.plugins.length is 5, window.chrome exists, and the Document prototype is intact. The old headless mode failed these exact checks. New headless is not a second-class browser — it is the browser.

Decision 3: the UA flag is a one-line fix with a real ceiling. It clears the User-Agent string — but look at the 20-point profile: something still leaks 20 points even with the string fixed. That something is the subject of the next section, and it is the reason “just set the UA” tutorials keep producing scrapers that die in production.

The tell that survives every UA fix

Chrome reports its identity through two independent channels: the legacy User-Agent string, and User-Agent Client Hints — structured data (navigator.userAgentData.brands, plus Sec-CH-UA-* request headers) that sites read instead of parsing the string. The --user-agent flag rewrites the string only. The brand list keeps its source of truth.

Measured, on the --headless=new + real-UA-flag profile, inside the page:

{
 "ua": "Mozilla/5.0 (X11; Linux x86_64) ... Chrome/156.0.0.0 Safari/537.36",
 "headlessInUA": false,
 "userAgentData": {"mobile": false, "platform": "Linux",
                   "brands": ["Not:A-Brand", "Chromium", "HeadlessChrome"]}
}

The string says Chrome. The structured channel says HeadlessChrome. Any detector doing navigator.userAgentData.brands.map(b => b.brand).join().includes('Headless') catches this profile instantly, no heuristics needed. This is why UA-string-only stealth passes screenshot eyeballing and still gets flagged by every serious vendor: the two channels disagree, and disagreement itself is the detection signal — you don’t even need to know which one is lying.

The complete fix requires overriding both channels, which CDP exposes as one call: Emulation.setUserAgentOverride with both userAgent and the matching userAgentMetadata block (brands, platform, versions — all of it). In our worker-test run, the override with metadata produced a fully coherent identity across main frame and workers. One measured surprise, though: the 2020-era claim that “CDP UA overrides don’t apply inside Workers” did not reproduce on Chrome 156 — string-only overrides were spoofed inside our dedicated Worker too. The folklore is dead; passing the full metadata block is the correct method for a different reason (consistency under deep UA-CH probing, e.g. getHighEntropyValues), not because of Worker leakage. Things that were true in Selenium-Puppeteer folklore don’t automatically survive into the current protocol implementation — measure, don’t inherit.

The cross-origin hole nobody patches

Here is the finding we could not find documented anywhere. Chrome runs cross-origin iframes in separate renderer processes (OOPIF — out-of-process iframes). CDP session-level overrides — what Playwright’s stealth forks and most home-grown stacks use — attach to the page target. The override never reaches the other process. Meanwhile, any third-party frame can read navigator.userAgent in its own context and message it home.

The test: embed https://example.org/agent.html (a tiny page that does parent.postMessage({type:'ua-report', ua: navigator.userAgent}, '*')) into the driven page, attach a CDP listener for Target.attachedToTarget to inject that reporter into the iframe’s session, and compare UAs:

# uaext_probe.py — where does the UA override actually apply?
# Sampled in every execution context: main frame, dedicated Worker,
# same-origin iframe, cross-origin iframe (via injected reporter). Exit 0.
#
# Key wiring (full script in the repo):
#   Target.setAutoAttach {autoAttach: true, flatten: true}
#     -> on Target.attachedToTarget where targetInfo.type == "iframe":
#          Runtime.evaluate REPORTER_JS in the iframe's session
#          (optionally: Emulation.setUserAgentOverride in that session)
REPORTER_JS = "parent.postMessage({type:'ua-report', ua: navigator.userAgent}, '*')"

Results on Chrome 156, verbatim from the run:

== baseline
   main         -> real      (HeadlessChrome/156.0.8078.4)
   worker       -> real
   iframeBlank  -> real
   iframeCross  -> real
== string-only override (main session only)
   main         -> spoofed   (Windows NT 10.0 ... Chrome/156.0.0.0)
   worker       -> spoofed
   iframeBlank  -> spoofed
   iframeCross  -> real      <-- THE LEAK
== propagated (override re-sent to every attached iframe session)
   main         -> spoofed
   worker       -> spoofed
   iframeBlank  -> spoofed
   iframeCross  -> spoofed

Parse that middle block. The operator believes they’re stealth: main frame Windows, worker Windows, same-origin frames Windows. Meanwhile the page’s ad slot, analytics frame, or an anti-bot vendor’s own embedded frame sits in its own process reporting HeadlessChrome/156.0.8078.4 to anyone collecting it. Cross-origin frames are precisely where third parties want to be — that’s the entire ad-tech and bot-vendor measurement model. One postMessage and the whole disguise is evidence.

The fix is the third block: handle Target.attachedToTarget, and re-apply Emulation.setUserAgentOverride in every iframe session (flat sessions make this a single socket; each child session gets its own override call). After propagation, the cross-origin frame reports spoofed too. Note the ordering subtlety we hit live: apply the main-session override after iframe sessions attach, or the last-applied override wins process-wide and you can end up with the inverse leak (iframe spoofed, main frame real — equally incriminating). Order of operations here is a bug class, not a detail.

And the deeper point: this hole generalizes. Any per-context patch — Object.defineProperty redefinitions on navigator, Function.toString shims, canvas-noise seeding — applies to the context you patched. Every Worker, every iframe, every isolated world is a fresh execution context with the browser’s real objects. CreepJS built an entire fingerprinting methodology on exactly this: matrix-checking the consistency of property descriptors across contexts and workers. Detector-side, consistency-checking is cheap and passive. Attacker-side, the only defense is architectural: patch at the browser layer (a build of Chromium, or flags like --user-agent that change process state), not at the JavaScript layer. Which is why the serious end of this market — the tools that survive DataDome-class targets — are patched browser builds, and why Playwright-with-a-stealth-plugin is not.

The GPU tell you can’t flag-spoof away

Even with identity coherent, the last 20 points come from the rendering stack. On a server with no GPU, Chrome falls back to SwiftShader — a software rasterizer — and WebGL reports it honestly:

vendor:   "Google Inc. (Google)"
renderer: "ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)"

No real user’s machine reports SwiftShader. We tested the flags: --use-angle=swiftshader produces the identical string (it’s the same renderer), and --use-gl=angle --use-angle=gl-egl-angle on a GPU-less host produces no WebGL context at all — a client that can’t render WebGL is its own anomaly. Your options, honestly ranked:

  1. Run where there’s a GPU. A $0.10-0.40/hr spot GPU instance (or any cloud box with a passthrough GPU) renders with a real driver string. This is the only complete fix, and it’s why serious scraping infra pays for GPU nodes that “just browse.”
  2. Spoof at the CDP/JS layer. Override WEBGL_debug_renderer_info getParameter responses — doable, but now you’re deep in the patch-every-context game from the last section, plus canvas/WebGL hash consistency checks (the noise you inject must be deterministic per-session, or the repeated-read check catches you).
  3. Targets that don’t check. Plenty of commercial targets only do TLS + UA scoring. For those, SwiftShader is fine. Diagnose before you spend.

What this costs, and what it’s worth

Same target, three stacks, honest math:

  • Requests-only + impersonation (last article’s stack): ~$0 compute beyond proxies. Survives TLS-layer-only targets. Dies at any JS challenge. Oxylabs residential traffic at $6/GB: a scraper pulling 50 GB/month pays $300, most of it wasted on pages whose challenge it can’t pass anyway.
  • chrome-headless-shell + stealth plugin: pays SwiftShader (20) + plugin/UA incoherences + the OOPIF leak. Against a vendor doing consistency checks this profile is worse than honest requests, because it’s identifiable and slow — headless-shell renders through software GL, at a fraction of real Chrome’s throughput.
  • Full Chrome --headless=new + coherent override incl. OOPIF + GPU node: instance cost ~$0.10-0.40/hr for the GPU box, proxy spend only on successful pages. This is the stack that holds sessions for months instead of hours, which is what actually moves the per-GB price down the curve — volume on a working stack beats volume on a burning one.

The arbitrage is in the gap between the $6/GB list price — which prices in somebody else’s browser-forensics problem — and what the raw signals actually cost to fix. The tooling to measure every one of them is an afternoon of CDP scripting. Most teams never write it; they discover each layer by burning a billing cycle on it.

Two directions from here, depending which side of the fence you’re on. If you build scrapers: wire probe_core.py and the detector into CI — assert your fleet’s UA-CH brands contain no “Headless”, the WebGL renderer matches your GPU inventory, and a canary cross-origin iframe reports the same UA as your main frame. If you defend a site: embed one cross-origin measuring frame, collect the UA reports, and diff them against the Sec-CH-UA headers on the main-frame request — the single-session override population fails that check today, identifiably and for free.

One more number for the “is browser work still serious” skeptics: in October 2026, Google paid its first $250,000 full-chain Chrome VRP reward — to XBOW, an autonomous agent, which went from zero to a working exploit chain in six days on roughly $40,000 of compute. The browser is where the money and the adversaries both are. Knowing what your automation leaks at the JavaScript layer is table stakes on both sides of that market — and, calibrated against a four-figure monthly unblocker bill, it is also one of the highest-ROI engineering skills in the scraping economy.

Running a data pipeline that keeps dying at the JS layer, or defending a site and want to know exactly what your traffic leaks? We build and audit browser automation stacks for a living — get in touch via /pages/hire-us or email [email protected].