зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1608516 - Part 3: Add a pref to prevent sending unnecessary IPC if we are not in testing. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D71940
This commit is contained in:
Родитель
4ec0106dae
Коммит
fbf29217f1
|
@ -5994,6 +5994,13 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
|
|||
UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(aStatus)) {
|
||||
UnblockEmbedderLoadEventForFailure();
|
||||
|
||||
// We don't really need to add the blocked node if we are not testing.
|
||||
// This could save a IPC here.
|
||||
if (!StaticPrefs::
|
||||
privacy_trackingprotection_testing_report_blocked_node()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RefPtr<BrowsingContext> bc = GetBrowsingContext();
|
||||
RefPtr<BrowsingContext> parentBC = bc->GetParent();
|
||||
|
||||
|
|
|
@ -7940,6 +7940,11 @@
|
|||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
- name: privacy.trackingprotection.testing.report_blocked_node
|
||||
type: RelaxedAtomicBool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Whether to spoof user locale to English (used as part of Resist
|
||||
# Fingerprinting).
|
||||
# 0 - will prompt
|
||||
|
|
|
@ -62,6 +62,7 @@ add_task(async function() {
|
|||
"privacy.restrict3rdpartystorage.userInteractionRequiredForHosts",
|
||||
"tracking.example.com,tracking.example.org",
|
||||
],
|
||||
["privacy.trackingprotection.testing.report_blocked_node", true],
|
||||
],
|
||||
});
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ add_task(async function() {
|
|||
"privacy.restrict3rdpartystorage.userInteractionRequiredForHosts",
|
||||
"tracking.example.com,tracking.example.org",
|
||||
],
|
||||
["privacy.trackingprotection.testing.report_blocked_node", true],
|
||||
],
|
||||
});
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ async function clearPermissions() {
|
|||
SpecialPowers.pushPrefEnv(
|
||||
{"set": [["urlclassifier.trackingTable", "moztest-track-simple"],
|
||||
["privacy.trackingprotection.enabled", true],
|
||||
["privacy.trackingprotection.testing.report_blocked_node", true],
|
||||
["channelclassifier.allowlist_example", true],
|
||||
["dom.security.skip_remote_script_assertion_in_system_priv_context", true]]},
|
||||
test);
|
||||
|
|
|
@ -131,6 +131,7 @@ function checkLoads(aWindow, aData) {
|
|||
function cleanup() {
|
||||
SpecialPowers.clearUserPref("privacy.trackingprotection.enabled");
|
||||
SpecialPowers.clearUserPref("channelclassifier.allowlist_example");
|
||||
SpecialPowers.clearUserPref("privacy.trackingprotection.testing.report_blocked_node");
|
||||
|
||||
UrlClassifierTestUtils.cleanupTestTrackers();
|
||||
}
|
||||
|
@ -148,6 +149,7 @@ async function test() {
|
|||
// any URIs unless 'https://allowlisted.example.com' is added in the
|
||||
// permission manager (see test_allowlisted_annotations.html)
|
||||
await SpecialPowers.setBoolPref("channelclassifier.allowlist_example", true);
|
||||
await SpecialPowers.setBoolPref("privacy.trackingprotection.testing.report_blocked_node", true);
|
||||
|
||||
await testOnWindow().then(function(aWindow) {
|
||||
aWindow.close();
|
||||
|
|
|
@ -111,6 +111,7 @@ SpecialPowers.pushPrefEnv(
|
|||
{"set": [
|
||||
["privacy.trackingprotection.enabled", false],
|
||||
["privacy.trackingprotection.pbmode.enabled", true],
|
||||
["privacy.trackingprotection.testing.report_blocked_node", true],
|
||||
]}, test);
|
||||
|
||||
async function test() {
|
||||
|
|
|
@ -109,6 +109,7 @@ function checkLoads(aWindow, aWhitelisted, tpEnabled) {
|
|||
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{"set": [["privacy.trackingprotection.enabled", true],
|
||||
["privacy.trackingprotection.testing.report_blocked_node", true],
|
||||
["channelclassifier.allowlist_example", true]]},
|
||||
test);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче