fix(stealth): synchronize TLS and JS fingerprints to Chrome 145

Upgraded wreq to 6.0.0-rc.29 and wreq-util to 3.0.0-rc.12 to apply the latest Chrome 145 TLS fingerprint (16 cipher suites, proper extension order, ALPS, GREASE).
 Introduced __obscura_stealth global to isolate stealth-specific JS behaviors from the standard execution path.
 Overrode navigator.userAgentData and getHighEntropyValues() in stealth mode to perfectly match the sec-ch-ua network headers.
 Restricted hardwareConcurrency and deviceMemory pools in stealth mode to desktop-realistic values (e.g., minimum 4 cores, 4GB RAM) to eliminate mobile-tier leaks.
 Fixed usedJSHeapSize occasionally exceeding totalJSHeapSize.
This commit is contained in:
SGavrl authored and GitHub committed 2026-06-11 17:53:15 +00:00
commit f58bb45956
6 files changed
+515 -157

No files matched your search

+17 -1
View File
@@ -130,7 +130,7 @@ impl ObscuraJsRuntime {
runtime
.execute_script(
"<obscura:init>",
"globalThis.__obscura_objects = {}; globalThis.__obscura_oid = 0; globalThis.__obscura_init();".to_string(),
"globalThis.__obscura_objects = {}; globalThis.__obscura_oid = 0;".to_string(),
)
.expect("init should not fail");
@@ -220,6 +220,22 @@ impl ObscuraJsRuntime {
);
}
pub fn set_stealth(&mut self, enabled: bool) {
let _ = self.runtime.execute_script(
"<set-stealth>",
format!("globalThis.__obscura_stealth = {};", enabled),
);
}
/// Run __obscura_init() after all per-page properties (UA, platform, stealth, etc.)
/// have been set. Must be called once per page setup, after all set_* methods.
pub fn run_page_init(&mut self) {
let _ = self.runtime.execute_script(
"<obscura:page-init>",
"globalThis.__obscura_init();".to_string(),
);
}
/// Override the coordinates the navigator.geolocation shim reports. The
/// values are injected as numeric globals the bootstrap reads; when unset it
/// keeps the built-in default. Callers validate the range before calling.