stealth: keep the Chrome 145 identity consistent across TLS, JS, and WebGL

Stealth mode forced a Linux navigator UA and platform but reported Windows
in userAgentData.getHighEntropyValues and served Windows Direct3D11 WebGL
renderers, a combination no real Linux Chrome ever produces and that
cross-layer fingerprint checks flag. Present one consistent Windows Chrome
145 identity instead: the wreq emulation uses Platform::Windows, and the
navigator surfaces read the UA and platform from shared constants so the
HTTP User-Agent header, sec-ch-ua-platform, navigator.userAgent, and
userAgentData all agree. userAgentData brands are now derived from the
Chrome major version via Chromium's GREASE algorithm rather than a single
hardcoded token, and a Linux WebGL renderer pool is added so a Linux UA can
never report a Direct3D11 renderer.
This commit is contained in:
SGavrl committed 2026-06-22 22:19:16 +00:00
1 parent dc780d77e4
commit 4309935abd
4 files changed
+74 -39

No files matched your search

+5 -3
View File
@@ -287,9 +287,11 @@ impl Page {
if self.stealth_client.is_some() {
rt.set_stealth(true);
rt.set_user_agent(obscura_net::STEALTH_USER_AGENT);
// Match platform to the Linux UA so navigator.platform and
// userAgentData.platform are consistent with navigator.userAgent.
rt.set_platform("Linux x86_64", "Linux", "");
rt.set_platform(
obscura_net::STEALTH_NAVIGATOR_PLATFORM,
obscura_net::STEALTH_UA_PLATFORM,
obscura_net::STEALTH_UA_PLATFORM_VERSION,
);
} else {
if let Ok(ua) = self.http_client.user_agent.try_read() {
rt.set_user_agent(&ua);