tor-commits
Threads by month
- ----- 2025 -----
- December
- 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
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 214510 discussions
[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
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
[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
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
[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
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
[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
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
[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
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
[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
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
[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
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
[Git][tpo/applications/mullvad-browser][mullvad-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
by Pier Angelo Vendrame (@pierov) 30 Sep '25
30 Sep '25
Pier Angelo Vendrame pushed to branch mullvad-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
80448594 by Pier Angelo Vendrame at 2025-09-30T12:51:26+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/mullvad-browser/-/commit/804…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/804…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser][tor-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
by Pier Angelo Vendrame (@pierov) 30 Sep '25
30 Sep '25
Pier Angelo Vendrame pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
eefc1906 by Pier Angelo Vendrame at 2025-09-30T11:44:50+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/eefc190…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/eefc190…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] fixup! BB 19741: Fix FPI with OpenSearch.
by Pier Angelo Vendrame (@pierov) 30 Sep '25
by Pier Angelo Vendrame (@pierov) 30 Sep '25
30 Sep '25
Pier Angelo Vendrame pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
55015024 by Pier Angelo Vendrame at 2025-09-30T11:36:17+02:00
fixup! BB 19741: Fix FPI with OpenSearch.
Fix the principal and add FPD also to opensearch images.
- - - - -
2 changed files:
- browser/components/search/SearchUIUtils.sys.mjs
- toolkit/components/search/SearchUtils.sys.mjs
Changes:
=====================================
browser/components/search/SearchUIUtils.sys.mjs
=====================================
@@ -184,7 +184,7 @@ export var SearchUIUtils = {
await Services.search.addOpenSearchEngine(
locationURL,
image,
- browsingContext?.originAttributes
+ browsingContext?.embedderElement?.contentPrincipal?.originAttributes
);
} catch (ex) {
let titleMsgName;
=====================================
toolkit/components/search/SearchUtils.sys.mjs
=====================================
@@ -253,10 +253,21 @@ export var SearchUtils = {
}
try {
let uri = typeof url == "string" ? Services.io.newURI(url) : url;
- let principal =
- uri.scheme == "moz-extension"
- ? Services.scriptSecurityManager.createContentPrincipal(uri, {})
- : Services.scriptSecurityManager.createNullPrincipal({});
+ let principal;
+ if (uri.scheme == "moz-extension") {
+ principal = Services.scriptSecurityManager.createContentPrincipal(
+ uri,
+ {}
+ );
+ } else {
+ let originAttributes = {};
+ try {
+ originAttributes.firstPartyDomain =
+ Services.eTLD.getSchemelessSite(uri);
+ } catch {}
+ principal =
+ Services.scriptSecurityManager.createNullPrincipal(originAttributes);
+ }
return Services.io.newChannelFromURI(
uri,
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5501502…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5501502…
You're receiving this email because of your account on gitlab.torproject.org.
1
0