Bug 1545273 - User-Interaction required for trackers only for some urls, set in privacy.restrict3rdpartystorage.userInteractionRequiredForHosts, r=Ehsan

This patch fixes a bug about when the
privacy.restrict3rdpartystorage.userInteractionRequiredForHosts should be
considered.

Differential Revision: https://phabricator.services.mozilla.com/D28155

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-04-25 19:39:35 +00:00
parent 79f14c2299
commit f8b91466be
2 changed files with 4 additions and 4 deletions

View File

@ -860,10 +860,9 @@ AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
enum : uint32_t {
blockReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER
};
if ((aReason != eOpenerAfterUserInteraction ||
nsContentUtils::IsURIInPrefList(trackingURI,
"privacy.restrict3rdpartystorage."
"userInteractionRequiredForHosts")) &&
if (nsContentUtils::IsURIInPrefList(trackingURI,
"privacy.restrict3rdpartystorage."
"userInteractionRequiredForHosts") &&
!HasUserInteraction(trackingPrincipal)) {
LOG_SPEC(("Tracking principal (%s) hasn't been interacted with before, "
"refusing to add a first-party storage permission to access it",

View File

@ -20,6 +20,7 @@ this.StoragePrincipalHelper = {
["privacy.trackingprotection.pbmode.enabled", false],
["privacy.trackingprotection.annotate_channels", true],
["privacy.storagePrincipal.enabledForTrackers", true],
["privacy.restrict3rdpartystorage.userInteractionRequiredForHosts", "tracking.example.com,tracking.example.org"],
]});
if (extraPrefs && Array.isArray(extraPrefs) && extraPrefs.length) {