From 266a28f53afe82ea522563fe8b30845da78863eb Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Mon, 22 Apr 2019 16:30:39 +0000 Subject: [PATCH] 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 --- toolkit/components/antitracking/AntiTrackingCommon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolkit/components/antitracking/AntiTrackingCommon.cpp b/toolkit/components/antitracking/AntiTrackingCommon.cpp index 78a8e9ca8589..1bafdd93624c 100644 --- a/toolkit/components/antitracking/AntiTrackingCommon.cpp +++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp @@ -860,10 +860,10 @@ AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor( enum : uint32_t { blockReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER }; - if ((aReason != eOpenerAfterUserInteraction || - nsContentUtils::IsURIInPrefList(trackingURI, - "privacy.restrict3rdpartystorage." - "userInteractionRequiredForHosts")) && + if (aReason != eOpenerAfterUserInteraction && + 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",