Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7808acaf7c81f81119a1d1b247ca5fd786715afa
      
https://github.com/WebKit/WebKit/commit/7808acaf7c81f81119a1d1b247ca5fd786715afa
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-09-18 (Fri, 18 Sep 2026)

  Changed paths:
    M Source/WebCore/page/NavigatorBase.cpp
    M Source/WebCore/platform/network/AdvancedPrivacyProtections.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ScriptTrackingPrivacyTests.mm

  Log Message:
  -----------
  [Script Tracking Privacy Protections] Randomized 
navigator.hardwareConcurrency should alternate between 4 and 8
https://bugs.webkit.org/show_bug.cgi?id=324585
rdar://177211562

Reviewed by Abrar Rahman Protyasha and Charlie Wolfe.

Currently, asking for `navigator.hardwareConcurrency` from within known 
fingerprinting scripts
yields a randomized value between 2-64, based on the noise injection seed. This 
can lead to weird
interactions with some bot detection heuristics, if (for instance) we end up 
with a bizarre number
of cores (e.g. 17).

To fix this, we adjust our strategy here to simply alternate between two 
"common" values (4 and 8)
in between every top-level navigation.

Test: ScriptTrackingPrivacyTests.HardwareConcurrency

* Source/WebCore/page/NavigatorBase.cpp:
(WebCore::NavigatorBase::hardwareConcurrency):
* Source/WebCore/platform/network/AdvancedPrivacyProtections.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::adjustAdvancedPrivacyProtectionsIfNeeded):
(WebKit::WebPageProxy::shouldUseOverrideHardwareConcurrency const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ScriptTrackingPrivacyTests.mm:
(TestWebKitAPI::(ScriptTrackingPrivacyTests, HardwareConcurrency)):

Canonical link: https://commits.webkit.org/321431@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to