Bug 1950985 - Add tracking protection skip for channels annotated as a consent manager. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D241468
This commit is contained in:
@@ -15551,6 +15551,18 @@
|
|||||||
value: true
|
value: true
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
|
# Skip blocking for consentmanager resources in all modes.
|
||||||
|
- name: privacy.trackingprotection.consentmanager.skip.enabled
|
||||||
|
type: RelaxedAtomicBool
|
||||||
|
value: false
|
||||||
|
mirror: always
|
||||||
|
|
||||||
|
# Skip blocking for consentmanager resources in Private Browsing mode.
|
||||||
|
- name: privacy.trackingprotection.consentmanager.skip.pbmode.enabled
|
||||||
|
type: RelaxedAtomicBool
|
||||||
|
value: true
|
||||||
|
mirror: always
|
||||||
|
|
||||||
# Whether to spoof user locale to English (used as part of Resist
|
# Whether to spoof user locale to English (used as part of Resist
|
||||||
# Fingerprinting).
|
# Fingerprinting).
|
||||||
# 0 - will prompt
|
# 0 - will prompt
|
||||||
|
|||||||
@@ -693,5 +693,36 @@ bool UrlClassifierCommon::IsPassiveContent(nsIChannel* aChannel) {
|
|||||||
!StaticPrefs::security_mixed_content_block_object_subrequest());
|
!StaticPrefs::security_mixed_content_block_object_subrequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */
|
||||||
|
bool UrlClassifierCommon::ShouldProcessWithProtectionFeature(
|
||||||
|
nsIChannel* aChannel) {
|
||||||
|
MOZ_ASSERT(aChannel);
|
||||||
|
|
||||||
|
bool shouldProcess = true;
|
||||||
|
|
||||||
|
if (!(StaticPrefs::privacy_trackingprotection_consentmanager_skip_enabled() ||
|
||||||
|
(StaticPrefs::
|
||||||
|
privacy_trackingprotection_consentmanager_skip_pbmode_enabled() &&
|
||||||
|
NS_UsePrivateBrowsing(aChannel)))) {
|
||||||
|
return shouldProcess;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCOMPtr<nsIClassifiedChannel> classifiedChannel =
|
||||||
|
do_QueryInterface(aChannel);
|
||||||
|
|
||||||
|
if (classifiedChannel) {
|
||||||
|
shouldProcess =
|
||||||
|
!(classifiedChannel->GetClassificationFlags() &
|
||||||
|
nsIClassifiedChannel::ClassificationFlags::CLASSIFIED_CONSENTMANAGER);
|
||||||
|
|
||||||
|
UC_LOG(
|
||||||
|
("UrlClassifierCommon::ShouldProcessWithProtectionFeature - "
|
||||||
|
"shouldProcess=%d for channel %p",
|
||||||
|
shouldProcess, aChannel));
|
||||||
|
}
|
||||||
|
|
||||||
|
return shouldProcess;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ class UrlClassifierCommon final {
|
|||||||
uint32_t aClassificationFlags,
|
uint32_t aClassificationFlags,
|
||||||
bool aIsThirdParty);
|
bool aIsThirdParty);
|
||||||
|
|
||||||
|
static bool ShouldProcessWithProtectionFeature(nsIChannel* aChannel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static uint32_t TableToClassificationFlag(
|
static uint32_t TableToClassificationFlag(
|
||||||
const nsACString& aTable, const std::vector<ClassificationData>& aData);
|
const nsACString& aTable, const std::vector<ClassificationData>& aData);
|
||||||
|
|||||||
@@ -144,6 +144,15 @@ UrlClassifierFeatureCryptominingProtection::ProcessChannel(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShouldProcessByProtectionFeature =
|
||||||
|
UrlClassifierCommon::ShouldProcessWithProtectionFeature(aChannel);
|
||||||
|
|
||||||
|
*aShouldContinue = !ShouldProcessByProtectionFeature;
|
||||||
|
|
||||||
|
if (!ShouldProcessByProtectionFeature) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoCString list;
|
nsAutoCString list;
|
||||||
UrlClassifierCommon::TablesToString(aList, list);
|
UrlClassifierCommon::TablesToString(aList, list);
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,15 @@ UrlClassifierFeatureEmailTrackingProtection::ProcessChannel(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShouldProcessByProtectionFeature =
|
||||||
|
UrlClassifierCommon::ShouldProcessWithProtectionFeature(aChannel);
|
||||||
|
|
||||||
|
*aShouldContinue = !ShouldProcessByProtectionFeature;
|
||||||
|
|
||||||
|
if (!ShouldProcessByProtectionFeature) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoCString list;
|
nsAutoCString list;
|
||||||
UrlClassifierCommon::TablesToString(aList, list);
|
UrlClassifierCommon::TablesToString(aList, list);
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,15 @@ UrlClassifierFeatureFingerprintingProtection::ProcessChannel(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShouldProcessByProtectionFeature =
|
||||||
|
UrlClassifierCommon::ShouldProcessWithProtectionFeature(aChannel);
|
||||||
|
|
||||||
|
*aShouldContinue = !ShouldProcessByProtectionFeature;
|
||||||
|
|
||||||
|
if (!ShouldProcessByProtectionFeature) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoCString list;
|
nsAutoCString list;
|
||||||
UrlClassifierCommon::TablesToString(aList, list);
|
UrlClassifierCommon::TablesToString(aList, list);
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,15 @@ UrlClassifierFeatureSocialTrackingProtection::ProcessChannel(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShouldProcessByProtectionFeature =
|
||||||
|
UrlClassifierCommon::ShouldProcessWithProtectionFeature(aChannel);
|
||||||
|
|
||||||
|
*aShouldContinue = !ShouldProcessByProtectionFeature;
|
||||||
|
|
||||||
|
if (!ShouldProcessByProtectionFeature) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoCString list;
|
nsAutoCString list;
|
||||||
UrlClassifierCommon::TablesToString(aList, list);
|
UrlClassifierCommon::TablesToString(aList, list);
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,15 @@ UrlClassifierFeatureTrackingProtection::ProcessChannel(
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShouldProcessByProtectionFeature =
|
||||||
|
UrlClassifierCommon::ShouldProcessWithProtectionFeature(aChannel);
|
||||||
|
|
||||||
|
*aShouldContinue = !ShouldProcessByProtectionFeature;
|
||||||
|
|
||||||
|
if (!ShouldProcessByProtectionFeature) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoCString list;
|
nsAutoCString list;
|
||||||
UrlClassifierCommon::TablesToString(aList, list);
|
UrlClassifierCommon::TablesToString(aList, list);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user