-
Sync sec-ch-ua with User-Agent and keep WebGL alive in stealth mode
发布于
2026-02-13 04:10:47 +00:00 Fix a bug where magic mode and per-request UA overrides would change
the User-Agent header without updating the sec-ch-ua (browser hint)
header to match. Anti-bot systems like Akamai detect this mismatch
as a bot signal.Changes:
- Regenerate browser_hint via UAGen.generate_client_hints() whenever
the UA is changed at crawl time (magic mode or explicit override) - Re-apply updated headers to the page via set_extra_http_headers()
- Skip per-crawl UA override for persistent contexts where the UA is
locked at launch time by Playwright's protocol layer - Move --disable-gpu flags behind enable_stealth check so WebGL works
via SwiftShader when stealth mode is active (missing WebGL is a
detectable headless signal) - Clean up old test scripts, add clean anti-bot test
下载附件
- Regenerate browser_hint via UAGen.generate_client_hints() whenever