fix(stealth): use Chrome's native UA Client Hints unless an explicit UA is set
The synthesized UA persona is inconsistent with what a real Chrome emits —
a fingerprint tell observable via navigator.userAgentData:
- navigator.userAgent carries the full build (e.g. "Chrome/146.0.7680.80");
real Chrome freezes it to "146.0.0.0" (UA reduction, v100+).
- getHighEntropyValues() returns a stale GREASE brand ("Not(A:Brand";v="99"
vs the current "Not-A.Brand";v="24"), a hardcoded platformVersion, and an
EMPTY uaFullVersion (cdproto's UserAgentMetadata has no full_version field,
so the override cannot populate it).
- Pinning --user-agent at launch ALSO empties Chrome's native high-entropy
UA-CH (architecture/platformVersion/uaFullVersion/fullVersionList) entirely.
When no explicit custom UA is configured, defer to the browser's native,
self-consistent UA + UA-CH: don't pin --user-agent (launch.go) and don't
apply the UA-CH metadata override (emulation.go). The persona override still
applies when an explicit custom UA is set. Also freeze the version-derived
UA build to <major>.0.0.0 (ua.go). Verified: native values match a stock
Chrome field-for-field.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> A
AriaShishegaran committed
41dd159be309fc4ae762908e4130ce35bb5977bc
Parent: c20ebac