Skip to content

fix: headless UA override — platform-agnostic Akamai bypass#26

Merged
drewstone merged 1 commit intomainfrom
fix/headless-ua-platform-agnostic
Mar 19, 2026
Merged

fix: headless UA override — platform-agnostic Akamai bypass#26
drewstone merged 1 commit intomainfrom
fix/headless-ua-platform-agnostic

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Summary

  • Headless Chromium sends HeadlessChrome/... in User-Agent by default
  • CDNs like Akamai reject these at HTTP/2 layer (ERR_HTTP2_PROTOCOL_ERROR) before any JS stealth patches run
  • Override context UA in headless mode with clean Chrome string using actual browser version + host OS platform token (macOS/Linux/Windows)
  • Recovers 7 Akamai-fronted sites previously "unreachable" in headless (28→~35/50 expected)

Test plan

  • pnpm build passes
  • Run headless WEBBENCH subset against known Akamai sites (apple.com, espn.com, etc.) to confirm recovery
  • Verify headed mode unaffected (headlessUserAgent is undefined when not headless)

Headless Chromium embeds "HeadlessChrome/..." in the default User-Agent.
CDNs like Akamai reject these requests at the HTTP/2 layer with
ERR_HTTP2_PROTOCOL_ERROR before any JS stealth patches can run.

Override the context UA in headless mode with a clean Chrome string that
uses the actual browser version and adapts the platform token to the
host OS (macOS/Linux/Windows).

Recovers 7 Akamai-fronted sites that were previously "unreachable" in
headless mode (28/50 → ~35/50 expected).
@drewstone drewstone merged commit f9fc7f8 into main Mar 19, 2026
5 checks passed
drewstone added a commit that referenced this pull request Mar 19, 2026
Unpublished since 0.10.0:
- feat: screenX/screenY CDP fix for Cloudflare Turnstile (#29)
- fix: boost output tokens near max turns (#28)
- feat: canvas fingerprint noise + stealth patches (#27)
- fix: headless UA override — platform-agnostic Akamai bypass (#26)
- fix: nightly CI — Xvfb headed stealth + system Chrome (#25)
- feat: retry malformed JSON with minimal context (#24)
- feat: three-tier history compression -22% cost (#23)
- feat: headless passthrough + Docker benchmark runner (#22)
- feat: WebVoyager + WebArena benchmark adapters (#20)
- fix: graceful recovery from execute wall-clock timeouts (#21)
- feat: showcase command for marketing asset capture (#18)
- feat: research pipeline + speed-v1 experiment results (#19)
- feat: design rip, compare, and extract-tokens overhaul (#17)
- feat: CDP connection, browser profiles, and asset downloader (#16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant