lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2025 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

September 2025

  • 1 participants
  • 213 discussions
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] fixup! [android] Disable features and functionality
by clairehurst (@clairehurst) 30 Sep '25

30 Sep '25
clairehurst pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: e2b56df1 by clairehurst at 2025-09-30T16:16:53-06:00 fixup! [android] Disable features and functionality tor-browser#44080 Further remove "Analytics data collection and usage" - - - - - 1 changed file: - mobile/android/fenix/app/src/main/AndroidManifest.xml Changes: ===================================== mobile/android/fenix/app/src/main/AndroidManifest.xml ===================================== @@ -746,13 +746,19 @@ <meta-data android:name="firebase_messaging_auto_init_enabled" - android:value="true" /> + android:value="false" /> <meta-data android:name="firebase_analytics_collection_enabled" android:value="false" /> <meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" /> + <meta-data + android:name="google_analytics_adid_collection_enabled" + android:value="false" /> + <meta-data + android:name="google_analytics_default_allow_ad_personalization_signals" + android:value="false" /> <!-- Removes the default Workmanager initialization so that we can use on-demand initializer. --> <provider android:name="androidx.startup.InitializationProvider" View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e2b56df… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e2b56df… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] 2 commits: TB 40041 [android]: Implement Tor Network Settings
by brizental (@brizental) 30 Sep '25

30 Sep '25
brizental pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: ca6d41d8 by Beatriz Rizental at 2025-09-30T18:38:03+02:00 TB 40041 [android]: Implement Tor Network Settings Undo rebase mistake. An unrelated pref was accidentally disabled in this commit. We do want it disabled, it's just unrelated here. Will remove it from here and then add it to another commit. - - - - - f84cc6f0 by Beatriz Rizental at 2025-09-30T18:38:03+02:00 fixup! [android] Override settings Disable "Sent from Firefox" share thingy. - - - - - 2 changed files: - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt - mobile/android/fenix/app/src/main/res/xml/preferences.xml Changes: ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt ===================================== @@ -739,7 +739,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { var whatsappLinkSharingEnabled by lazyFeatureFlagPreference( key = appContext.getPreferenceKey(R.string.pref_key_link_sharing), featureFlag = true, - default = { FxNimbus.features.sentFromFirefox.value().enabled }, + default = { false }, ) var linkSharingSettingsSnackbarShown by booleanPreference( ===================================== mobile/android/fenix/app/src/main/res/xml/preferences.xml ===================================== @@ -232,12 +232,13 @@ app:iconSpaceReserved="false" android:title="@string/preferences_customize_extension_collection" /> - <!-- <androidx.preference.Preference android:key="@string/pref_key_link_sharing" app:iconSpaceReserved="false" + app:isPreferenceVisible="false" android:title="@string/preferences_link_sharing" /> + <!-- <androidx.preference.Preference android:key="@string/pref_key_open_links_in_apps" android:title="@string/preferences_open_links_in_apps" View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d2f8f4… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d2f8f4… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] fixup! [android] Disable features and functionality
by brizental (@brizental) 30 Sep '25

30 Sep '25
brizental pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: d2f8f495 by Beatriz Rizental at 2025-09-30T17:20:51+02:00 fixup! [android] Disable features and functionality Disable access to advertising ID. - - - - - 1 changed file: - mobile/android/fenix/app/src/main/AndroidManifest.xml Changes: ===================================== mobile/android/fenix/app/src/main/AndroidManifest.xml ===================================== @@ -30,6 +30,9 @@ <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.USE_BIOMETRIC" /> + <!-- tor-browser#43729: Disable access to the advertising ID --> + <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" /> + <!-- Needed to prompt the user to give permission to install a downloaded apk --> <uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d2f8f49… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d2f8f49… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-140.3.0esr-15.0-1] 2 commits: fixup! BB 43902: Modify the new sidebar for Base Browser.
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch mullvad-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 4fdb4cb7 by Henry Wilkes at 2025-09-30T13:47:26+00:00 fixup! BB 43902: Modify the new sidebar for Base Browser. TB 44159: Change the sidebar description. - - - - - a39547a2 by Henry Wilkes at 2025-09-30T13:47:27+00:00 fixup! Base Browser strings TB 44159: Add an alternative sidebar description for base browser. - - - - - 2 changed files: - browser/components/preferences/main.inc.xhtml - toolkit/locales/en-US/toolkit/global/base-browser.ftl Changes: ===================================== browser/components/preferences/main.inc.xhtml ===================================== @@ -199,7 +199,7 @@ </radiogroup> <checkbox id="browserLayoutShowSidebar" data-l10n-id="browser-layout-show-sidebar" preference="sidebar.revamp"/> - <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc"></description> + <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc-limited"></description> </groupbox> <!-- Letterboxing --> ===================================== toolkit/locales/en-US/toolkit/global/base-browser.ftl ===================================== @@ -97,6 +97,10 @@ letterboxing-disabled-description = Letterboxing is currently disabled. letterboxing-enable-button = .label = Enable Letterboxing +## Preferences - Sidebar. + +browser-layout-show-sidebar-desc-limited = Quickly access bookmarks and more without leaving your main view. + ## Security level toolbar button. ## Uses sentence case in English (US). ## ".label" is the accessible name, and shown in the overflow menu and when customizing the toolbar. View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/4b… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/4b… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-140.3.0esr-15.0-1] 2 commits: fixup! BB 43902: Modify the new sidebar for Base Browser.
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch base-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 33e61fe1 by Henry Wilkes at 2025-09-30T13:46:18+00:00 fixup! BB 43902: Modify the new sidebar for Base Browser. TB 44159: Change the sidebar description. - - - - - 62c74272 by Henry Wilkes at 2025-09-30T13:46:18+00:00 fixup! Base Browser strings TB 44159: Add an alternative sidebar description for base browser. - - - - - 2 changed files: - browser/components/preferences/main.inc.xhtml - toolkit/locales/en-US/toolkit/global/base-browser.ftl Changes: ===================================== browser/components/preferences/main.inc.xhtml ===================================== @@ -199,7 +199,7 @@ </radiogroup> <checkbox id="browserLayoutShowSidebar" data-l10n-id="browser-layout-show-sidebar" preference="sidebar.revamp"/> - <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc"></description> + <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc-limited"></description> </groupbox> <!-- Letterboxing --> ===================================== toolkit/locales/en-US/toolkit/global/base-browser.ftl ===================================== @@ -97,6 +97,10 @@ letterboxing-disabled-description = Letterboxing is currently disabled. letterboxing-enable-button = .label = Enable Letterboxing +## Preferences - Sidebar. + +browser-layout-show-sidebar-desc-limited = Quickly access bookmarks and more without leaving your main view. + ## Security level toolbar button. ## Uses sentence case in English (US). ## ".label" is the accessible name, and shown in the overflow menu and when customizing the toolbar. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/9ebed8… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/9ebed8… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] 2 commits: fixup! BB 43902: Modify the new sidebar for Base Browser.
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 7172cae9 by Henry Wilkes at 2025-09-30T13:39:27+00:00 fixup! BB 43902: Modify the new sidebar for Base Browser. TB 44159: Change the sidebar description. - - - - - e9ec0f2c by Henry Wilkes at 2025-09-30T13:39:27+00:00 fixup! Base Browser strings TB 44159: Add an alternative sidebar description for base browser. - - - - - 2 changed files: - browser/components/preferences/main.inc.xhtml - toolkit/locales/en-US/toolkit/global/base-browser.ftl Changes: ===================================== browser/components/preferences/main.inc.xhtml ===================================== @@ -199,7 +199,7 @@ </radiogroup> <checkbox id="browserLayoutShowSidebar" data-l10n-id="browser-layout-show-sidebar" preference="sidebar.revamp"/> - <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc"></description> + <description class="indent" data-l10n-id="browser-layout-show-sidebar-desc-limited"></description> </groupbox> <!-- Letterboxing --> ===================================== toolkit/locales/en-US/toolkit/global/base-browser.ftl ===================================== @@ -97,6 +97,10 @@ letterboxing-disabled-description = Letterboxing is currently disabled. letterboxing-enable-button = .label = Enable Letterboxing +## Preferences - Sidebar. + +browser-layout-show-sidebar-desc-limited = Quickly access bookmarks and more without leaving your main view. + ## Security level toolbar button. ## Uses sentence case in English (US). ## ".label" is the accessible name, and shown in the overflow menu and when customizing the toolbar. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/40d60a… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/40d60a… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-140.3.0esr-15.0-1] Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch mullvad-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 4bfdd99a by Fatih Kilic at 2025-09-30T13:38:08+00:00 Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang Differential Revision: https://phabricator.services.mozilla.com/D261936 - - - - - 28 changed files: - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - browser/components/resistfingerprinting/test/browser/head.js - dom/base/Navigator.cpp - dom/base/test/test_navigator_hardwareConcurrency.html - dom/workers/RuntimeService.cpp - dom/workers/RuntimeService.h - dom/workers/WorkerNavigator.cpp - dom/workers/test/test_navigator_workers_hardwareConcurrency.html - toolkit/components/resistfingerprinting/RFPTargets.inc - toolkit/components/resistfingerprinting/RFPTargetsDefault.inc - toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js - toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js ===================================== @@ -10,7 +10,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -27,6 +28,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js ===================================== @@ -23,7 +23,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -40,6 +41,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js ===================================== @@ -16,7 +16,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -33,6 +34,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -88,7 +88,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -121,6 +122,12 @@ const SPOOFED_UA_GECKO_TRAIL = { add_setup(async () => { DEFAULT_OSCPU.win = DEFAULT_UA_OS.win = await WindowsOscpuPromise; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); async function testUserAgentHeader() { ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -103,7 +103,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -306,6 +307,12 @@ add_setup(async () => { framer_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, framee_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, }; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); const uri = `https://${FRAMER_DOMAIN}/browser/browser/components/resistfingerprinting/test/browser/file_navigator_iframer.html`; ===================================== browser/components/resistfingerprinting/test/browser/head.js ===================================== @@ -908,7 +908,7 @@ async function RFPPBMFPP_NormalMode_NoProtectionsTest( ["privacy.fingerprintingProtection", true], [ "privacy.fingerprintingProtection.overrides", - "-NavigatorHWConcurrency,-CanvasRandomization", + "-NavigatorHWConcurrency,-NavigatorHWConcurrencyTiered,-CanvasRandomization", ], ].concat(extraPrefs || []), }); ===================================== dom/base/Navigator.cpp ===================================== @@ -690,7 +690,9 @@ uint64_t Navigator::HardwareConcurrency() { return rts->ClampedHardwareConcurrency( nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency)); + RFPTarget::NavigatorHWConcurrency), + nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } namespace { ===================================== dom/base/test/test_navigator_hardwareConcurrency.html ===================================== @@ -19,8 +19,10 @@ SimpleTest.waitForExplicitFinish(); resistFingerprinting(true).then(() => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; + const y = navigator.hardwareConcurrency; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { const z = navigator.hardwareConcurrency; ===================================== dom/workers/RuntimeService.cpp ===================================== @@ -1980,13 +1980,18 @@ void RuntimeService::MemoryPressureAllWorkers() { BroadcastAllWorkers([](auto& worker) { worker.MemoryPressure(); }); } -uint32_t RuntimeService::ClampedHardwareConcurrency( - bool aShouldResistFingerprinting) const { - // The Firefox Hardware Report says 70% of Firefox users have exactly 2 cores. +uint32_t RuntimeService::ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const { + // The Firefox Hardware Report says 34% of Firefox users have exactly 4 cores. // When the resistFingerprinting pref is set, we want to blend into the crowd - // so spoof navigator.hardwareConcurrency = 2 to reduce user uniqueness. - if (MOZ_UNLIKELY(aShouldResistFingerprinting)) { - return 2; + // so spoof navigator.hardwareConcurrency = 4 to reduce user uniqueness. On + // OSX, the majority of Macs have 8 cores. + if (MOZ_UNLIKELY(aRFPHardcoded)) { +#ifdef XP_MACOSX + return 8; +#else + return 4; +#endif } // This needs to be atomic, because multiple workers, and even mainthread, @@ -2014,6 +2019,13 @@ uint32_t RuntimeService::ClampedHardwareConcurrency( numberOfProcessors); } + if (MOZ_UNLIKELY(aRFPTiered)) { + if (unclampedHardwareConcurrency >= 8) { + return 8; + } + return 4; + } + return std::min(uint32_t(unclampedHardwareConcurrency), StaticPrefs::dom_maxHardwareConcurrency()); } ===================================== dom/workers/RuntimeService.h ===================================== @@ -164,7 +164,8 @@ class RuntimeService final : public nsIObserver { void MemoryPressureAllWorkers(); - uint32_t ClampedHardwareConcurrency(bool aShouldResistFingerprinting) const; + uint32_t ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const; void CrashIfHanging(); ===================================== dom/workers/WorkerNavigator.cpp ===================================== @@ -222,10 +222,12 @@ uint64_t WorkerNavigator::HardwareConcurrency() const { MOZ_ASSERT(rts); WorkerPrivate* aWorkerPrivate = GetCurrentThreadWorkerPrivate(); - bool rfp = aWorkerPrivate->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency); - return rts->ClampedHardwareConcurrency(rfp); + return rts->ClampedHardwareConcurrency( + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrency), + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } StorageManager* WorkerNavigator::Storage() { ===================================== dom/workers/test/test_navigator_workers_hardwareConcurrency.html ===================================== @@ -31,8 +31,9 @@ resistFingerprinting(true).then(() => { ok(true, "resistFingerprinting(true) resolved."); getWorkerHardwareConcurrency(msg => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const y = msg.data; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { ok(true, "resistFingerprinting(false) resolved."); ===================================== toolkit/components/resistfingerprinting/RFPTargets.inc ===================================== @@ -102,6 +102,7 @@ ITEM_VALUE(ScreenAvailToResolution, 68) ITEM_VALUE(UseHardcodedFontSubstitutes, 69) ITEM_VALUE(DiskStorageLimit, 70) ITEM_VALUE(WebCodecs, 71) +ITEM_VALUE(NavigatorHWConcurrencyTiered,74) // !!! Don't forget to update kDefaultFingerprintingProtections in nsRFPService.cpp ===================================== toolkit/components/resistfingerprinting/RFPTargetsDefault.inc ===================================== @@ -6,7 +6,9 @@ DESKTOP_DEFAULT(CanvasRandomization) DESKTOP_DEFAULT(FontVisibilityLangPack) DESKTOP_DEFAULT(JSMathFdlibm) +DESKTOP_DEFAULT(NavigatorHWConcurrencyTiered) ANDROID_DEFAULT(CanvasRandomization) ANDROID_DEFAULT(FontVisibilityLangPack) ANDROID_DEFAULT(JSMathFdlibm) +ANDROID_DEFAULT(NavigatorHWConcurrencyTiered) ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js ===================================== @@ -44,7 +44,8 @@ runTestInFirstAndThirdPartyContexts( ); }, async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the third-party window. if (!win.sw) { ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js ===================================== @@ -7,7 +7,8 @@ runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { @@ -90,7 +91,8 @@ runTestInFirstAndThirdPartyContexts( runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context with FPI enabled.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/4bf… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/4bf… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-140.3.0esr-15.0-1] Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch base-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 9ebed81f by Fatih Kilic at 2025-09-30T13:31:11+00:00 Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang Differential Revision: https://phabricator.services.mozilla.com/D261936 - - - - - 28 changed files: - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - browser/components/resistfingerprinting/test/browser/head.js - dom/base/Navigator.cpp - dom/base/test/test_navigator_hardwareConcurrency.html - dom/workers/RuntimeService.cpp - dom/workers/RuntimeService.h - dom/workers/WorkerNavigator.cpp - dom/workers/test/test_navigator_workers_hardwareConcurrency.html - toolkit/components/resistfingerprinting/RFPTargets.inc - toolkit/components/resistfingerprinting/RFPTargetsDefault.inc - toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js - toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js ===================================== @@ -10,7 +10,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -27,6 +28,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js ===================================== @@ -23,7 +23,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -40,6 +41,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js ===================================== @@ -16,7 +16,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -33,6 +34,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -88,7 +88,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -121,6 +122,12 @@ const SPOOFED_UA_GECKO_TRAIL = { add_setup(async () => { DEFAULT_OSCPU.win = DEFAULT_UA_OS.win = await WindowsOscpuPromise; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); async function testUserAgentHeader() { ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -103,7 +103,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -306,6 +307,12 @@ add_setup(async () => { framer_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, framee_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, }; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); const uri = `https://${FRAMER_DOMAIN}/browser/browser/components/resistfingerprinting/test/browser/file_navigator_iframer.html`; ===================================== browser/components/resistfingerprinting/test/browser/head.js ===================================== @@ -908,7 +908,7 @@ async function RFPPBMFPP_NormalMode_NoProtectionsTest( ["privacy.fingerprintingProtection", true], [ "privacy.fingerprintingProtection.overrides", - "-NavigatorHWConcurrency,-CanvasRandomization", + "-NavigatorHWConcurrency,-NavigatorHWConcurrencyTiered,-CanvasRandomization", ], ].concat(extraPrefs || []), }); ===================================== dom/base/Navigator.cpp ===================================== @@ -690,7 +690,9 @@ uint64_t Navigator::HardwareConcurrency() { return rts->ClampedHardwareConcurrency( nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency)); + RFPTarget::NavigatorHWConcurrency), + nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } namespace { ===================================== dom/base/test/test_navigator_hardwareConcurrency.html ===================================== @@ -19,8 +19,10 @@ SimpleTest.waitForExplicitFinish(); resistFingerprinting(true).then(() => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; + const y = navigator.hardwareConcurrency; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { const z = navigator.hardwareConcurrency; ===================================== dom/workers/RuntimeService.cpp ===================================== @@ -1980,13 +1980,18 @@ void RuntimeService::MemoryPressureAllWorkers() { BroadcastAllWorkers([](auto& worker) { worker.MemoryPressure(); }); } -uint32_t RuntimeService::ClampedHardwareConcurrency( - bool aShouldResistFingerprinting) const { - // The Firefox Hardware Report says 70% of Firefox users have exactly 2 cores. +uint32_t RuntimeService::ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const { + // The Firefox Hardware Report says 34% of Firefox users have exactly 4 cores. // When the resistFingerprinting pref is set, we want to blend into the crowd - // so spoof navigator.hardwareConcurrency = 2 to reduce user uniqueness. - if (MOZ_UNLIKELY(aShouldResistFingerprinting)) { - return 2; + // so spoof navigator.hardwareConcurrency = 4 to reduce user uniqueness. On + // OSX, the majority of Macs have 8 cores. + if (MOZ_UNLIKELY(aRFPHardcoded)) { +#ifdef XP_MACOSX + return 8; +#else + return 4; +#endif } // This needs to be atomic, because multiple workers, and even mainthread, @@ -2014,6 +2019,13 @@ uint32_t RuntimeService::ClampedHardwareConcurrency( numberOfProcessors); } + if (MOZ_UNLIKELY(aRFPTiered)) { + if (unclampedHardwareConcurrency >= 8) { + return 8; + } + return 4; + } + return std::min(uint32_t(unclampedHardwareConcurrency), StaticPrefs::dom_maxHardwareConcurrency()); } ===================================== dom/workers/RuntimeService.h ===================================== @@ -164,7 +164,8 @@ class RuntimeService final : public nsIObserver { void MemoryPressureAllWorkers(); - uint32_t ClampedHardwareConcurrency(bool aShouldResistFingerprinting) const; + uint32_t ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const; void CrashIfHanging(); ===================================== dom/workers/WorkerNavigator.cpp ===================================== @@ -222,10 +222,12 @@ uint64_t WorkerNavigator::HardwareConcurrency() const { MOZ_ASSERT(rts); WorkerPrivate* aWorkerPrivate = GetCurrentThreadWorkerPrivate(); - bool rfp = aWorkerPrivate->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency); - return rts->ClampedHardwareConcurrency(rfp); + return rts->ClampedHardwareConcurrency( + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrency), + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } StorageManager* WorkerNavigator::Storage() { ===================================== dom/workers/test/test_navigator_workers_hardwareConcurrency.html ===================================== @@ -31,8 +31,9 @@ resistFingerprinting(true).then(() => { ok(true, "resistFingerprinting(true) resolved."); getWorkerHardwareConcurrency(msg => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const y = msg.data; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { ok(true, "resistFingerprinting(false) resolved."); ===================================== toolkit/components/resistfingerprinting/RFPTargets.inc ===================================== @@ -102,6 +102,7 @@ ITEM_VALUE(ScreenAvailToResolution, 68) ITEM_VALUE(UseHardcodedFontSubstitutes, 69) ITEM_VALUE(DiskStorageLimit, 70) ITEM_VALUE(WebCodecs, 71) +ITEM_VALUE(NavigatorHWConcurrencyTiered,74) // !!! Don't forget to update kDefaultFingerprintingProtections in nsRFPService.cpp ===================================== toolkit/components/resistfingerprinting/RFPTargetsDefault.inc ===================================== @@ -6,7 +6,9 @@ DESKTOP_DEFAULT(CanvasRandomization) DESKTOP_DEFAULT(FontVisibilityLangPack) DESKTOP_DEFAULT(JSMathFdlibm) +DESKTOP_DEFAULT(NavigatorHWConcurrencyTiered) ANDROID_DEFAULT(CanvasRandomization) ANDROID_DEFAULT(FontVisibilityLangPack) ANDROID_DEFAULT(JSMathFdlibm) +ANDROID_DEFAULT(NavigatorHWConcurrencyTiered) ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js ===================================== @@ -44,7 +44,8 @@ runTestInFirstAndThirdPartyContexts( ); }, async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the third-party window. if (!win.sw) { ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js ===================================== @@ -7,7 +7,8 @@ runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { @@ -90,7 +91,8 @@ runTestInFirstAndThirdPartyContexts( runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context with FPI enabled.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9ebed81… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9ebed81… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang
by morgan (@morgan) 30 Sep '25

30 Sep '25
morgan pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 40d60a9e by Fatih Kilic at 2025-09-30T13:22:00+00:00 Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang Differential Revision: https://phabricator.services.mozilla.com/D261936 - - - - - 28 changed files: - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js - browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - browser/components/resistfingerprinting/test/browser/head.js - dom/base/Navigator.cpp - dom/base/test/test_navigator_hardwareConcurrency.html - dom/workers/RuntimeService.cpp - dom/workers/RuntimeService.h - dom/workers/WorkerNavigator.cpp - dom/workers/test/test_navigator_workers_hardwareConcurrency.html - toolkit/components/resistfingerprinting/RFPTargets.inc - toolkit/components/resistfingerprinting/RFPTargetsDefault.inc - toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js - toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_etp_iframes.js ===================================== @@ -10,7 +10,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -27,6 +28,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutblank.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_aboutsrcdoc.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blob.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_blobcrossorigin.js ===================================== @@ -23,7 +23,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -40,6 +41,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_data.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_iframes_sandboxediframe.js ===================================== @@ -20,7 +20,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups.js ===================================== @@ -16,7 +16,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -33,6 +34,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_aboutblank.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_blob_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_data_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_hwconcurrency_popups_noopener.js ===================================== @@ -15,7 +15,8 @@ "use strict"; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency; @@ -32,6 +33,14 @@ async function testHWConcurrency(result, expectedResults, extraData) { ); } +add_setup(async function () { + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); +}); + // The following are convenience objects that allow you to quickly see what is // and is not modified from a logical set of values. // Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -88,7 +88,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -121,6 +122,12 @@ const SPOOFED_UA_GECKO_TRAIL = { add_setup(async () => { DEFAULT_OSCPU.win = DEFAULT_UA_OS.win = await WindowsOscpuPromise; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); async function testUserAgentHeader() { ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -103,7 +103,8 @@ const SPOOFED_UA_OS = { android: "Android 10; Mobile", other: "X11; Linux x86_64", }; -const SPOOFED_HW_CONCURRENCY = 2; +const SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const CONST_APPCODENAME = "Mozilla"; const CONST_APPNAME = "Netscape"; @@ -306,6 +307,12 @@ add_setup(async () => { framer_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, framee_crossOrigin_userAgentHTTPHeader: spoofedUserAgent, }; + + registerCleanupFunction(async function () { + Services.prefs.clearUserPref( + "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings" + ); + }); }); const uri = `https://${FRAMER_DOMAIN}/browser/browser/components/resistfingerprinting/test/browser/file_navigator_iframer.html`; ===================================== browser/components/resistfingerprinting/test/browser/head.js ===================================== @@ -908,7 +908,7 @@ async function RFPPBMFPP_NormalMode_NoProtectionsTest( ["privacy.fingerprintingProtection", true], [ "privacy.fingerprintingProtection.overrides", - "-NavigatorHWConcurrency,-CanvasRandomization", + "-NavigatorHWConcurrency,-NavigatorHWConcurrencyTiered,-CanvasRandomization", ], ].concat(extraPrefs || []), }); ===================================== dom/base/Navigator.cpp ===================================== @@ -690,7 +690,9 @@ uint64_t Navigator::HardwareConcurrency() { return rts->ClampedHardwareConcurrency( nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency)); + RFPTarget::NavigatorHWConcurrency), + nsGlobalWindowInner::Cast(mWindow)->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } namespace { ===================================== dom/base/test/test_navigator_hardwareConcurrency.html ===================================== @@ -19,8 +19,10 @@ SimpleTest.waitForExplicitFinish(); resistFingerprinting(true).then(() => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; + const y = navigator.hardwareConcurrency; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { const z = navigator.hardwareConcurrency; ===================================== dom/workers/RuntimeService.cpp ===================================== @@ -1980,13 +1980,18 @@ void RuntimeService::MemoryPressureAllWorkers() { BroadcastAllWorkers([](auto& worker) { worker.MemoryPressure(); }); } -uint32_t RuntimeService::ClampedHardwareConcurrency( - bool aShouldResistFingerprinting) const { - // The Firefox Hardware Report says 70% of Firefox users have exactly 2 cores. +uint32_t RuntimeService::ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const { + // The Firefox Hardware Report says 34% of Firefox users have exactly 4 cores. // When the resistFingerprinting pref is set, we want to blend into the crowd - // so spoof navigator.hardwareConcurrency = 2 to reduce user uniqueness. - if (MOZ_UNLIKELY(aShouldResistFingerprinting)) { - return 2; + // so spoof navigator.hardwareConcurrency = 4 to reduce user uniqueness. On + // OSX, the majority of Macs have 8 cores. + if (MOZ_UNLIKELY(aRFPHardcoded)) { +#ifdef XP_MACOSX + return 8; +#else + return 4; +#endif } // This needs to be atomic, because multiple workers, and even mainthread, @@ -2014,6 +2019,13 @@ uint32_t RuntimeService::ClampedHardwareConcurrency( numberOfProcessors); } + if (MOZ_UNLIKELY(aRFPTiered)) { + if (unclampedHardwareConcurrency >= 8) { + return 8; + } + return 4; + } + return std::min(uint32_t(unclampedHardwareConcurrency), StaticPrefs::dom_maxHardwareConcurrency()); } ===================================== dom/workers/RuntimeService.h ===================================== @@ -164,7 +164,8 @@ class RuntimeService final : public nsIObserver { void MemoryPressureAllWorkers(); - uint32_t ClampedHardwareConcurrency(bool aShouldResistFingerprinting) const; + uint32_t ClampedHardwareConcurrency(bool aRFPHardcoded, + bool aRFPTiered) const; void CrashIfHanging(); ===================================== dom/workers/WorkerNavigator.cpp ===================================== @@ -222,10 +222,12 @@ uint64_t WorkerNavigator::HardwareConcurrency() const { MOZ_ASSERT(rts); WorkerPrivate* aWorkerPrivate = GetCurrentThreadWorkerPrivate(); - bool rfp = aWorkerPrivate->ShouldResistFingerprinting( - RFPTarget::NavigatorHWConcurrency); - return rts->ClampedHardwareConcurrency(rfp); + return rts->ClampedHardwareConcurrency( + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrency), + aWorkerPrivate->ShouldResistFingerprinting( + RFPTarget::NavigatorHWConcurrencyTiered)); } StorageManager* WorkerNavigator::Storage() { ===================================== dom/workers/test/test_navigator_workers_hardwareConcurrency.html ===================================== @@ -31,8 +31,9 @@ resistFingerprinting(true).then(() => { ok(true, "resistFingerprinting(true) resolved."); getWorkerHardwareConcurrency(msg => { + const expected = SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; const y = msg.data; - ok(y === 2, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); + ok(y === expected, "hardwareConcurrency should always be 2 when we're resisting fingerprinting."); resistFingerprinting(false).then(() => { ok(true, "resistFingerprinting(false) resolved."); ===================================== toolkit/components/resistfingerprinting/RFPTargets.inc ===================================== @@ -102,6 +102,7 @@ ITEM_VALUE(ScreenAvailToResolution, 68) ITEM_VALUE(UseHardcodedFontSubstitutes, 69) ITEM_VALUE(DiskStorageLimit, 70) ITEM_VALUE(WebCodecs, 71) +ITEM_VALUE(NavigatorHWConcurrencyTiered,74) // !!! Don't forget to update kDefaultFingerprintingProtections in nsRFPService.cpp ===================================== toolkit/components/resistfingerprinting/RFPTargetsDefault.inc ===================================== @@ -6,7 +6,9 @@ DESKTOP_DEFAULT(CanvasRandomization) DESKTOP_DEFAULT(FontVisibilityLangPack) DESKTOP_DEFAULT(JSMathFdlibm) +DESKTOP_DEFAULT(NavigatorHWConcurrencyTiered) ANDROID_DEFAULT(CanvasRandomization) ANDROID_DEFAULT(FontVisibilityLangPack) ANDROID_DEFAULT(JSMathFdlibm) +ANDROID_DEFAULT(NavigatorHWConcurrencyTiered) ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_fpiServiceWorkers_fingerprinting.js ===================================== @@ -44,7 +44,8 @@ runTestInFirstAndThirdPartyContexts( ); }, async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the third-party window. if (!win.sw) { ===================================== toolkit/components/resistfingerprinting/tests/browser/browser_serviceWorker_fingerprinting_webcompat.js ===================================== @@ -7,7 +7,8 @@ runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { @@ -90,7 +91,8 @@ runTestInFirstAndThirdPartyContexts( runTestInFirstAndThirdPartyContexts( "ServiceWorkers - Ensure the fingerprinting WebCompat overrides the fingerprinting protection in third-party context with FPI enabled.", async win => { - let SPOOFED_HW_CONCURRENCY = 2; + let SPOOFED_HW_CONCURRENCY = + SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4; // Register service worker for the first-party window. if (!win.sw) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/40d60a9… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/40d60a9… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-140.3.0esr-15.0-1] Bug 1990520 - Remove a console.error that could be too noisy in certain...
by Pier Angelo Vendrame (@pierov) 30 Sep '25

30 Sep '25
Pier Angelo Vendrame pushed to branch base-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: dcb45914 by Pier Angelo Vendrame at 2025-09-30T12:51:55+02:00 Bug 1990520 - Remove a console.error that could be too noisy in certain configurations. r=sessionstore-reviewers,sthompson Differential Revision: https://phabricator.services.mozilla.com/D266034 - - - - - 1 changed file: - browser/components/sessionstore/SessionStore.sys.mjs Changes: ===================================== browser/components/sessionstore/SessionStore.sys.mjs ===================================== @@ -5874,7 +5874,6 @@ var SessionStoreInternal = { return true; } catch (error) { // Can't setup speculative connection for this url. - console.error(error); return false; } } View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dcb4591… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dcb4591… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 22
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.