From fc1699a5267317b99243758f02e2521a73b4c5aa Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Wed, 10 Jun 2026 08:46:42 +0900 Subject: [PATCH] fix(stealth): navigator.platform = MacIntel/Win32/Linux x86_64 (was UA-CH value) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit platform_string() feeds the CDP Emulation.setUserAgentOverride 'platform' field, which sets the LEGACY navigator.platform. It was returning the UA-CH form ("macOS"/"Linux") — but real Chrome reports navigator.platform = "MacIntel" on macOS and "Linux x86_64" on Linux. "macOS" contradicts the UA's "Intel Mac OS X" and is a trivial bot-detection tell (platform vs UA mismatch). UA-CH (navigator.userAgentData.platform via platform_hint) stays "macOS"/"Windows"/ "Linux" — that form is correct there. Verified locally on bot.sannysoft.com (all rows green incl. navigator.platform= MacIntel) + eval probes: webdriver false, no Headless in UA, real WebGL (Apple M3 Metal, not SwiftShader), plugins/permissions consistent. --- cli/src/native/stealth.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/src/native/stealth.rs b/cli/src/native/stealth.rs index 9cffdfd..c53e6a0 100644 --- a/cli/src/native/stealth.rs +++ b/cli/src/native/stealth.rs @@ -270,13 +270,18 @@ pub fn strip_source_url_labels(input: &str) -> String { re_block.replace_all(&output, "").to_string() } +/// The legacy `navigator.platform` value (set via the CDP +/// `Emulation.setUserAgentOverride` `platform` field). This is NOT the UA-CH +/// platform (see `platform_hint`): real Chrome reports `MacIntel` on macOS and +/// `Linux x86_64` on Linux, so emitting the UA-CH form ("macOS"/"Linux") here is +/// a detectable mismatch against the UA's "Intel Mac OS X" / Linux strings. fn platform_string() -> &'static str { if cfg!(target_os = "macos") { - "macOS" + "MacIntel" } else if cfg!(target_os = "windows") { "Win32" } else { - "Linux" + "Linux x86_64" } }