stealth: gate JS behaviours, upgrade wreq, fix fp consistency

wreq upgraded 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).

__obscura_stealth global variable introduced and passed from Rust to JS,
allowing stealth-specific JS behaviors to run only when the stealth flag
is enabled.

Tightened hardwareConcurrency and deviceMemory pools in stealth mode
to desktop-realistic values (e.g. min 4GB RAM, 4 cores), eliminating
mobile-tier values that leak the spoof.

navigator.userAgentData and getHighEntropyValues() are now overridden
in stealth mode to perfectly match the sec-ch-ua header sent by
wreq_util::Profile::Chrome145.

Fixed usedJSHeapSize sometimes exceeding totalJSHeapSize.
This commit is contained in:
SGavrl committed 2026-06-11 17:22:50 +00:00
1 parent dc2c585511
commit 56ab54e615
6 files changed
+197 -108

No files matched your search

+3
View File
@@ -275,6 +275,7 @@ impl Page {
#[cfg(feature = "stealth")]
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.
@@ -315,6 +316,8 @@ impl Page {
rt.set_dom(dom);
}
rt.run_page_init();
self.js = Some(rt);
}