зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1437626 - P3. Use global tracking Protection pref when a channel doesn't have a loadcontext r=baku
Channels loaded by service worker don't have loadcontext, so we don't apply tracking protection on them. Depends on D80183 Differential Revision: https://phabricator.services.mozilla.com/D80184
This commit is contained in:
Родитель
f334f91266
Коммит
4f69aa8fa0
|
@ -81,7 +81,15 @@ UrlClassifierFeatureTrackingProtection::MaybeCreate(nsIChannel* aChannel) {
|
|||
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
NS_QueryNotificationCallbacks(aChannel, loadContext);
|
||||
if (!loadContext || !loadContext->UseTrackingProtection()) {
|
||||
if (!loadContext) {
|
||||
// Some channels don't have a loadcontext, check the global tracking
|
||||
// protection preference.
|
||||
if (!StaticPrefs::privacy_trackingprotection_enabled() &&
|
||||
!(NS_UsePrivateBrowsing(aChannel) &&
|
||||
StaticPrefs::privacy_trackingprotection_pbmode_enabled())) {
|
||||
return nullptr;
|
||||
}
|
||||
} else if (!loadContext->UseTrackingProtection()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче