Bug 1545273 - User-Interaction required for trackers only for some urls, set in privacy.restrict3rdpartystorage.userInteractionRequiredForHosts, r=Ehsan a=pascalc
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 25 Apr 2019 19:39:35 +0000
changeset 526378 d1a98fb42cb80151d902b1f54881048abe05fc4f
parent 526377 48d5d72cf8b84d7dc2530242a7989ea8ea1acc8b
child 526379 19ffc912b996739412ab0ca8346e06742919c7ee
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan, pascalc
bugs1545273
milestone67.0
Bug 1545273 - User-Interaction required for trackers only for some urls, set in privacy.restrict3rdpartystorage.userInteractionRequiredForHosts, r=Ehsan a=pascalc This patch fixes a bug about when the privacy.restrict3rdpartystorage.userInteractionRequiredForHosts should be considered. Differential Revision: https://phabricator.services.mozilla.com/D28155
toolkit/components/antitracking/AntiTrackingCommon.cpp
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -827,20 +827,19 @@ AntiTrackingCommon::AddFirstPartyStorage
   // parent, without having received the permission itself yet.
   //
   // We define this as an enum, since without that MSVC fails to capturing this
   // name inside the lambda without the explicit capture and clang warns if
   // there is an explicit capture with -Wunused-lambda-capture.
   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",
               _spec),
              trackingURI);
     NotifyBlockingDecision(aParentWindow, BlockingDecision::eBlock,
                            blockReason);
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);