Bug 1945142: Backout D234215. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D236356
This commit is contained in:
@@ -8,6 +8,7 @@ support-files = [
|
|||||||
"file_keyBoardEvent.sjs",
|
"file_keyBoardEvent.sjs",
|
||||||
"file_navigator.html",
|
"file_navigator.html",
|
||||||
"file_navigator.worker.js",
|
"file_navigator.worker.js",
|
||||||
|
"file_workerNetInfo.js",
|
||||||
"file_workerPerformance.js",
|
"file_workerPerformance.js",
|
||||||
"head.js",
|
"head.js",
|
||||||
"file_canvascompare_aboutblank_iframee.html",
|
"file_canvascompare_aboutblank_iframee.html",
|
||||||
@@ -80,8 +81,6 @@ https_first_disabled = true
|
|||||||
|
|
||||||
["browser_canvascompare_popups_data.js"]
|
["browser_canvascompare_popups_data.js"]
|
||||||
|
|
||||||
["browser_color_scheme.js"]
|
|
||||||
|
|
||||||
["browser_cross_origin_isolated_animation_api.js"]
|
["browser_cross_origin_isolated_animation_api.js"]
|
||||||
|
|
||||||
["browser_cross_origin_isolated_performance_api.js"]
|
["browser_cross_origin_isolated_performance_api.js"]
|
||||||
@@ -138,6 +137,9 @@ https_first_disabled = true
|
|||||||
["browser_navigator_iframes.js"]
|
["browser_navigator_iframes.js"]
|
||||||
https_first_disabled = true
|
https_first_disabled = true
|
||||||
|
|
||||||
|
["browser_netInfo.js"]
|
||||||
|
https_first_disabled = true
|
||||||
|
|
||||||
["browser_performanceAPI.js"]
|
["browser_performanceAPI.js"]
|
||||||
|
|
||||||
["browser_performanceAPIWorkers.js"]
|
["browser_performanceAPIWorkers.js"]
|
||||||
@@ -158,3 +160,5 @@ https_first_disabled = true
|
|||||||
["browser_spoofing_keyboard_event.js"]
|
["browser_spoofing_keyboard_event.js"]
|
||||||
|
|
||||||
["browser_timezone.js"]
|
["browser_timezone.js"]
|
||||||
|
|
||||||
|
["browser_color_scheme.js"]
|
||||||
|
|||||||
@@ -346,7 +346,6 @@ add_task(async function setupRFPExemptions() {
|
|||||||
set: [
|
set: [
|
||||||
["privacy.resistFingerprinting", true],
|
["privacy.resistFingerprinting", true],
|
||||||
["privacy.resistFingerprinting.exemptedDomains", "example.net"],
|
["privacy.resistFingerprinting.exemptedDomains", "example.net"],
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -442,10 +441,7 @@ add_task(async function setupETPToggleExemptions() {
|
|||||||
|
|
||||||
add_task(async function setupResistFingerprinting() {
|
add_task(async function setupResistFingerprinting() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let spoofedGeckoTrail = SPOOFED_UA_GECKO_TRAIL[AppConstants.platform];
|
let spoofedGeckoTrail = SPOOFED_UA_GECKO_TRAIL[AppConstants.platform];
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/**
|
||||||
|
* Bug 1372072 - A test case for check whether network information API has been
|
||||||
|
* spoofed correctly when 'privacy.resistFingerprinting' is true;
|
||||||
|
*/
|
||||||
|
|
||||||
|
async function testWindow() {
|
||||||
|
// Open a tab to test network information in a content.
|
||||||
|
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||||
|
gBrowser,
|
||||||
|
TEST_PATH + "file_dummy.html"
|
||||||
|
);
|
||||||
|
|
||||||
|
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||||
|
ok("connection" in content.navigator, "navigator.connection should exist");
|
||||||
|
|
||||||
|
is(
|
||||||
|
content.navigator.connection.type,
|
||||||
|
"unknown",
|
||||||
|
"The connection type is spoofed correctly"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function testWorker() {
|
||||||
|
// Open a tab to test network information in a worker.
|
||||||
|
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||||
|
gBrowser,
|
||||||
|
TEST_PATH + "file_dummy.html"
|
||||||
|
);
|
||||||
|
|
||||||
|
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||||
|
await new Promise(resolve => {
|
||||||
|
let worker = new content.Worker("file_workerNetInfo.js");
|
||||||
|
|
||||||
|
worker.onmessage = function (e) {
|
||||||
|
if (e.data.type == "status") {
|
||||||
|
ok(e.data.status, e.data.msg);
|
||||||
|
} else if (e.data.type == "finish") {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
ok(false, "Unknown message type");
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
worker.postMessage({ type: "runTests" });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
BrowserTestUtils.removeTab(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
add_task(async function runTest() {
|
||||||
|
await SpecialPowers.pushPrefEnv({
|
||||||
|
set: [
|
||||||
|
["privacy.resistFingerprinting", true],
|
||||||
|
["dom.netinfo.enabled", true],
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
await testWindow();
|
||||||
|
await testWorker();
|
||||||
|
});
|
||||||
@@ -34,24 +34,23 @@ add_task(async function test_new_window() {
|
|||||||
tab.linkedBrowser,
|
tab.linkedBrowser,
|
||||||
[{ gMaxAvailWidth, gMaxAvailHeight }],
|
[{ gMaxAvailWidth, gMaxAvailHeight }],
|
||||||
async function (input) {
|
async function (input) {
|
||||||
let windowWaived = content.wrappedJSObject.window;
|
|
||||||
is(
|
is(
|
||||||
windowWaived.screen.width,
|
content.screen.width,
|
||||||
input.gMaxAvailWidth,
|
input.gMaxAvailWidth,
|
||||||
"The screen.width has a correct rounded value"
|
"The screen.width has a correct rounded value"
|
||||||
);
|
);
|
||||||
is(
|
is(
|
||||||
windowWaived.screen.height,
|
content.screen.height,
|
||||||
input.gMaxAvailHeight,
|
input.gMaxAvailHeight,
|
||||||
"The screen.height has a correct rounded value"
|
"The screen.height has a correct rounded value"
|
||||||
);
|
);
|
||||||
is(
|
is(
|
||||||
windowWaived.innerWidth,
|
content.innerWidth,
|
||||||
input.gMaxAvailWidth,
|
input.gMaxAvailWidth,
|
||||||
"The window.innerWidth has a correct rounded value"
|
"The window.innerWidth has a correct rounded value"
|
||||||
);
|
);
|
||||||
is(
|
is(
|
||||||
windowWaived.innerHeight,
|
content.innerHeight,
|
||||||
input.gMaxAvailHeight,
|
input.gMaxAvailHeight,
|
||||||
"The window.innerHeight has a correct rounded value"
|
"The window.innerHeight has a correct rounded value"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,27 +7,23 @@
|
|||||||
let targetWidth = Services.prefs.getIntPref("privacy.window.maxInnerWidth");
|
let targetWidth = Services.prefs.getIntPref("privacy.window.maxInnerWidth");
|
||||||
let targetHeight = Services.prefs.getIntPref("privacy.window.maxInnerHeight");
|
let targetHeight = Services.prefs.getIntPref("privacy.window.maxInnerHeight");
|
||||||
|
|
||||||
OpenTest.run(
|
OpenTest.run([
|
||||||
[
|
{
|
||||||
{
|
settingWidth: targetWidth + 25,
|
||||||
settingWidth: targetWidth + 25,
|
settingHeight: targetHeight + 50,
|
||||||
settingHeight: targetHeight + 50,
|
targetWidth,
|
||||||
targetWidth,
|
targetHeight,
|
||||||
targetHeight,
|
},
|
||||||
},
|
{
|
||||||
{
|
settingWidth: 9999,
|
||||||
settingWidth: 9999,
|
settingHeight: 9999,
|
||||||
settingHeight: 9999,
|
targetWidth,
|
||||||
targetWidth,
|
targetHeight,
|
||||||
targetHeight,
|
},
|
||||||
},
|
{
|
||||||
{
|
settingWidth: targetWidth - 1,
|
||||||
settingWidth: targetWidth - 1,
|
settingHeight: targetHeight - 1,
|
||||||
settingHeight: targetHeight - 1,
|
targetWidth,
|
||||||
targetWidth,
|
targetHeight,
|
||||||
targetHeight,
|
},
|
||||||
},
|
]);
|
||||||
],
|
|
||||||
undefined,
|
|
||||||
[["privacy.resistFingerprinting.principalCheckEnabled", false]]
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -4,27 +4,23 @@
|
|||||||
* middle values.
|
* middle values.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OpenTest.run(
|
OpenTest.run([
|
||||||
[
|
{
|
||||||
{
|
settingWidth: 600,
|
||||||
settingWidth: 600,
|
settingHeight: 600,
|
||||||
settingHeight: 600,
|
targetWidth: 600,
|
||||||
targetWidth: 600,
|
targetHeight: 600,
|
||||||
targetHeight: 600,
|
},
|
||||||
},
|
{
|
||||||
{
|
settingWidth: 599,
|
||||||
settingWidth: 599,
|
settingHeight: 599,
|
||||||
settingHeight: 599,
|
targetWidth: 600,
|
||||||
targetWidth: 600,
|
targetHeight: 600,
|
||||||
targetHeight: 600,
|
},
|
||||||
},
|
{
|
||||||
{
|
settingWidth: 401,
|
||||||
settingWidth: 401,
|
settingHeight: 501,
|
||||||
settingHeight: 501,
|
targetWidth: 600,
|
||||||
targetWidth: 600,
|
targetHeight: 600,
|
||||||
targetHeight: 600,
|
},
|
||||||
},
|
]);
|
||||||
],
|
|
||||||
undefined,
|
|
||||||
[["privacy.resistFingerprinting.principalCheckEnabled", false]]
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -4,21 +4,17 @@
|
|||||||
* minimum values.
|
* minimum values.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OpenTest.run(
|
OpenTest.run([
|
||||||
[
|
{
|
||||||
{
|
settingWidth: 199,
|
||||||
settingWidth: 199,
|
settingHeight: 99,
|
||||||
settingHeight: 99,
|
targetWidth: 200,
|
||||||
targetWidth: 200,
|
targetHeight: 100,
|
||||||
targetHeight: 100,
|
},
|
||||||
},
|
{
|
||||||
{
|
settingWidth: 10,
|
||||||
settingWidth: 10,
|
settingHeight: 10,
|
||||||
settingHeight: 10,
|
targetWidth: 200,
|
||||||
targetWidth: 200,
|
targetHeight: 100,
|
||||||
targetHeight: 100,
|
},
|
||||||
},
|
]);
|
||||||
],
|
|
||||||
undefined,
|
|
||||||
[["privacy.resistFingerprinting.principalCheckEnabled", false]]
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -2119,11 +2119,7 @@ function eventConsumer(aEvent) {
|
|||||||
|
|
||||||
add_setup(async function () {
|
add_setup(async function () {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
// Disable the principal check because synthesizeKey is system privileged.
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -555,11 +555,11 @@ async function testWindowSizeSetting(
|
|||||||
|
|
||||||
class RoundedWindowTest {
|
class RoundedWindowTest {
|
||||||
// testOuter is optional. run() can be invoked with only 1 parameter.
|
// testOuter is optional. run() can be invoked with only 1 parameter.
|
||||||
static run(testCases, testOuter, extraPrefs = []) {
|
static run(testCases, testOuter) {
|
||||||
// "this" is the calling class itself.
|
// "this" is the calling class itself.
|
||||||
// e.g. when invoked by RoundedWindowTest.run(), "this" is "class RoundedWindowTest".
|
// e.g. when invoked by RoundedWindowTest.run(), "this" is "class RoundedWindowTest".
|
||||||
let test = new this(testCases);
|
let test = new this(testCases);
|
||||||
add_task(async () => test.setup(extraPrefs));
|
add_task(async () => test.setup());
|
||||||
add_task(async () => {
|
add_task(async () => {
|
||||||
if (testOuter == undefined) {
|
if (testOuter == undefined) {
|
||||||
// If testOuter is not given, do tests for both inner and outer.
|
// If testOuter is not given, do tests for both inner and outer.
|
||||||
@@ -575,9 +575,9 @@ class RoundedWindowTest {
|
|||||||
this.testCases = testCases;
|
this.testCases = testCases;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setup(extraPrefs) {
|
async setup() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [["privacy.resistFingerprinting", true], ...extraPrefs],
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
|
// Calculate the popup window's chrome UI size for tests of outerWidth/Height.
|
||||||
@@ -668,15 +668,7 @@ async function runActualTest(uri, testFunction, expectedResults, extraData) {
|
|||||||
browserWin = openedWin.gBrowser;
|
browserWin = openedWin.gBrowser;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is hacky, but since we added IsJSContextCurrentlyChromePrivileged(),
|
|
||||||
// we ended up disabling RFP for this tab because the test suite
|
|
||||||
// has the system principal when it opens it. So we disable the
|
|
||||||
// principal check for a brief moment.
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["privacy.resistFingerprinting.principalCheckEnabled", false]],
|
|
||||||
});
|
|
||||||
let tab = await BrowserTestUtils.openNewForegroundTab(browserWin, uri);
|
let tab = await BrowserTestUtils.openNewForegroundTab(browserWin, uri);
|
||||||
await SpecialPowers.popPrefEnv();
|
|
||||||
|
|
||||||
if ("etp_reload" in extraData) {
|
if ("etp_reload" in extraData) {
|
||||||
ContentBlockingAllowList.add(tab.linkedBrowser);
|
ContentBlockingAllowList.add(tab.linkedBrowser);
|
||||||
@@ -710,13 +702,11 @@ async function runActualTest(uri, testFunction, expectedResults, extraData) {
|
|||||||
tab.linkedBrowser,
|
tab.linkedBrowser,
|
||||||
[IFRAME_DOMAIN, CROSS_ORIGIN_DOMAIN, filterExtraData(extraData)],
|
[IFRAME_DOMAIN, CROSS_ORIGIN_DOMAIN, filterExtraData(extraData)],
|
||||||
async function (iframe_domain_, cross_origin_domain_, extraData_) {
|
async function (iframe_domain_, cross_origin_domain_, extraData_) {
|
||||||
return content.wrappedJSObject.eval(`
|
return content.wrappedJSObject.runTheTest(
|
||||||
runTheTest(
|
iframe_domain_,
|
||||||
${JSON.stringify(iframe_domain_)},
|
cross_origin_domain_,
|
||||||
${JSON.stringify(cross_origin_domain_)},
|
extraData_
|
||||||
${JSON.stringify(extraData_)}
|
);
|
||||||
);
|
|
||||||
`);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -731,7 +721,7 @@ async function runActualTest(uri, testFunction, expectedResults, extraData) {
|
|||||||
popup_tab.linkedBrowser,
|
popup_tab.linkedBrowser,
|
||||||
[],
|
[],
|
||||||
async function () {
|
async function () {
|
||||||
let r = content.wrappedJSObject.eval("give_result()");
|
let r = content.wrappedJSObject.give_result();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ tags = "resistfingerprinting"
|
|||||||
|
|
||||||
support-files = [
|
support-files = [
|
||||||
"file_animation_api.html",
|
"file_animation_api.html",
|
||||||
"file_workerNetInfo.js",
|
|
||||||
"worker_child.js",
|
"worker_child.js",
|
||||||
"worker_grandchild.js",
|
"worker_grandchild.js",
|
||||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||||
@@ -19,8 +18,6 @@ support-files = ["decode_error.mp4"]
|
|||||||
|
|
||||||
["test_bug1382499_touch_api.html"]
|
["test_bug1382499_touch_api.html"]
|
||||||
|
|
||||||
["test_bug1885101_screenwindow_sizes.html"]
|
|
||||||
|
|
||||||
["test_device_sensor_event.html"]
|
["test_device_sensor_event.html"]
|
||||||
|
|
||||||
["test_geolocation.html"]
|
["test_geolocation.html"]
|
||||||
@@ -32,11 +29,10 @@ support-files = ["test_hide_gamepad_info_iframe.html"]
|
|||||||
|
|
||||||
["test_keyboard_event.html"]
|
["test_keyboard_event.html"]
|
||||||
|
|
||||||
["test_netInfo.html"]
|
|
||||||
https_first_disabled = true
|
|
||||||
|
|
||||||
["test_pointer_event.html"]
|
["test_pointer_event.html"]
|
||||||
support-files = ["../../../../../dom/events/test/pointerevents/mochitest_support_external.js"]
|
support-files = ["../../../../../dom/events/test/pointerevents/mochitest_support_external.js"]
|
||||||
|
|
||||||
["test_speech_synthesis.html"]
|
["test_speech_synthesis.html"]
|
||||||
skip-if = ["verify"]
|
skip-if = ["verify"]
|
||||||
|
|
||||||
|
["test_bug1885101_screenwindow_sizes.html"]
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<meta charset="utf8">
|
|
||||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
<script>
|
|
||||||
/* global SimpleTest SpecialPowers */
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
|
||||||
SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["dom.netinfo.enabled", true],
|
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
],
|
|
||||||
}, async function() {
|
|
||||||
ok("connection" in navigator, "navigator.connection should exist");
|
|
||||||
|
|
||||||
is(
|
|
||||||
navigator.connection.type,
|
|
||||||
"unknown",
|
|
||||||
"The connection type is spoofed correctly"
|
|
||||||
);
|
|
||||||
|
|
||||||
await new Promise(resolve => {
|
|
||||||
let worker = new Worker("file_workerNetInfo.js");
|
|
||||||
|
|
||||||
worker.onmessage = function (e) {
|
|
||||||
if (e.data.type == "status") {
|
|
||||||
ok(e.data.status, e.data.msg);
|
|
||||||
} else if (e.data.type == "finish") {
|
|
||||||
resolve();
|
|
||||||
} else {
|
|
||||||
ok(false, "Unknown message type");
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
worker.postMessage({ type: "runTests" });
|
|
||||||
});
|
|
||||||
SimpleTest.finish();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -21,10 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1333641
|
|||||||
isnot(window.speechSynthesis.getVoices().length, 0, "Voices added");
|
isnot(window.speechSynthesis.getVoices().length, 0, "Voices added");
|
||||||
SimpleTest.waitForFocus(() => {
|
SimpleTest.waitForFocus(() => {
|
||||||
SpecialPowers.pushPrefEnv({"set":
|
SpecialPowers.pushPrefEnv({"set":
|
||||||
[
|
[["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false]
|
|
||||||
],
|
|
||||||
}, doGetVoicesTest);
|
}, doGetVoicesTest);
|
||||||
}, window);
|
}, window);
|
||||||
}, {once: true});
|
}, {once: true});
|
||||||
|
|||||||
@@ -2367,13 +2367,8 @@ bool ChromeUtils::ShouldResistFingerprinting(
|
|||||||
// This global object appears to be the global window, not for individual
|
// This global object appears to be the global window, not for individual
|
||||||
// sites so to exempt individual sites (instead of just PBM/Not-PBM windows)
|
// sites so to exempt individual sites (instead of just PBM/Not-PBM windows)
|
||||||
// more work would be needed to get the correct context.
|
// more work would be needed to get the correct context.
|
||||||
// We set aSkipChromePrincipalCheck to true because ChromeUtils is only
|
|
||||||
// called from chrome code where we are system principal.
|
|
||||||
// We only want to check document's properties and not JS context's
|
|
||||||
// properties.
|
|
||||||
return nsRFPService::IsRFPEnabledFor(isPBM, target,
|
return nsRFPService::IsRFPEnabledFor(isPBM, target,
|
||||||
overriddenFingerprintingSettings,
|
overriddenFingerprintingSettings);
|
||||||
/* aSkipChromePrincipalCheck */ true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
|||||||
@@ -8,10 +8,6 @@ do_get_profile();
|
|||||||
add_task(async function test_clear_fingerprinting_protection_state() {
|
add_task(async function test_clear_fingerprinting_protection_state() {
|
||||||
info("Enabling fingerprinting randomization");
|
info("Enabling fingerprinting randomization");
|
||||||
Services.prefs.setBoolPref("privacy.resistFingerprinting", true);
|
Services.prefs.setBoolPref("privacy.resistFingerprinting", true);
|
||||||
Services.prefs.setBoolPref(
|
|
||||||
"privacy.resistFingerprinting.principalCheckEnabled",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
let uri = Services.io.newURI("https://example.com");
|
let uri = Services.io.newURI("https://example.com");
|
||||||
let principal = Services.scriptSecurityManager.createContentPrincipal(
|
let principal = Services.scriptSecurityManager.createContentPrincipal(
|
||||||
@@ -163,19 +159,12 @@ add_task(async function test_clear_fingerprinting_protection_state() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Services.prefs.clearUserPref("privacy.resistFingerprinting");
|
Services.prefs.clearUserPref("privacy.resistFingerprinting");
|
||||||
Services.prefs.clearUserPref(
|
|
||||||
"privacy.resistFingerprinting.principalCheckEnabled"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(
|
add_task(
|
||||||
async function test_clear_fingerprinting_protection_state_by_site_and_pattern() {
|
async function test_clear_fingerprinting_protection_state_by_site_and_pattern() {
|
||||||
info("Enabling fingerprinting randomization");
|
info("Enabling fingerprinting randomization");
|
||||||
Services.prefs.setBoolPref("privacy.resistFingerprinting", true);
|
Services.prefs.setBoolPref("privacy.resistFingerprinting", true);
|
||||||
Services.prefs.setBoolPref(
|
|
||||||
"privacy.resistFingerprinting.principalCheckEnabled",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
let uri = Services.io.newURI("https://example.com");
|
let uri = Services.io.newURI("https://example.com");
|
||||||
let principal = Services.scriptSecurityManager.createContentPrincipal(
|
let principal = Services.scriptSecurityManager.createContentPrincipal(
|
||||||
@@ -256,8 +245,5 @@ add_task(
|
|||||||
);
|
);
|
||||||
|
|
||||||
Services.prefs.clearUserPref("privacy.resistFingerprinting");
|
Services.prefs.clearUserPref("privacy.resistFingerprinting");
|
||||||
Services.prefs.clearUserPref(
|
|
||||||
"privacy.resistFingerprinting.principalCheckEnabled"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ bool nsRFPService::IsRFPEnabledFor(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!aSkipChromePrincipalCheck && IsJSContextCurrentlyChromePrivileged()) {
|
if (IsJSContextCurrentlyChromePrivileged()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -424,7 +424,6 @@ async function runTest(enabled) {
|
|||||||
["privacy.fingerprintingProtection.pbmode", true],
|
["privacy.fingerprintingProtection.pbmode", true],
|
||||||
["privacy.fingerprintingProtection.overrides", RFPOverrides],
|
["privacy.fingerprintingProtection.overrides", RFPOverrides],
|
||||||
["privacy.resistFingerprinting", false],
|
["privacy.resistFingerprinting", false],
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ async function runTest(enabled) {
|
|||||||
["privacy.fingerprintingProtection.pbmode", true],
|
["privacy.fingerprintingProtection.pbmode", true],
|
||||||
["privacy.fingerprintingProtection.overrides", RFPOverrides],
|
["privacy.fingerprintingProtection.overrides", RFPOverrides],
|
||||||
["privacy.resistFingerprinting", false],
|
["privacy.resistFingerprinting", false],
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -213,10 +213,7 @@ add_task(async function test_randomization_disabled_with_rfp_disabled() {
|
|||||||
// Test the fingerprinting randomization key generation.
|
// Test the fingerprinting randomization key generation.
|
||||||
add_task(async function test_generate_randomization_key() {
|
add_task(async function test_generate_randomization_key() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let testPrivateWin of [true, false]) {
|
for (let testPrivateWin of [true, false]) {
|
||||||
@@ -307,10 +304,7 @@ add_task(async function test_generate_randomization_key() {
|
|||||||
// ends.
|
// ends.
|
||||||
add_task(async function test_reset_key_after_pbm_session_ends() {
|
add_task(async function test_reset_key_after_pbm_session_ends() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({
|
let privateWin = await BrowserTestUtils.openNewBrowserWindow({
|
||||||
@@ -368,7 +362,6 @@ add_task(async function test_randomization_with_exempted_normal_window() {
|
|||||||
["privacy.resistFingerprinting.pbmode", true],
|
["privacy.resistFingerprinting.pbmode", true],
|
||||||
["privacy.fingerprintingProtection", false],
|
["privacy.fingerprintingProtection", false],
|
||||||
["privacy.fingerprintingProtection.pbmode", false],
|
["privacy.fingerprintingProtection.pbmode", false],
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -433,10 +426,7 @@ add_task(async function test_randomization_with_exempted_normal_window() {
|
|||||||
add_task(async function test_reset_random_key_when_clear_site_data() {
|
add_task(async function test_reset_random_key_when_clear_site_data() {
|
||||||
// Enable fingerprinting randomization key generation.
|
// Enable fingerprinting randomization key generation.
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [["privacy.resistFingerprinting", true]],
|
||||||
["privacy.resistFingerprinting", true],
|
|
||||||
["privacy.resistFingerprinting.principalCheckEnabled", false],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Open a tab and get randomization key from the test domain.
|
// Open a tab and get randomization key from the test domain.
|
||||||
|
|||||||
Reference in New Issue
Block a user