Bug 1545273 - User-Interaction required for trackers only for some urls, set in privacy.restrict3rdpartystorage.userInteractionRequiredForHosts, r=Ehsan
☠☠ backed out by b48ddc1c59ba ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 22 Apr 2019 16:30:39 +0000
changeset 470385 5f0139ba25448132c646dfc706866998419af77f
parent 470384 efe40065f0ea38258a80f80b2330e63104281c51
child 470386 693db1b9922562f45461bb53b80a6cf34cf130d6
push id35905
push userdvarga@mozilla.com
push dateTue, 23 Apr 2019 09:53:27 +0000
treeherdermozilla-central@831918f009f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1545273
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
toolkit/components/antitracking/AntiTrackingCommon.cpp
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -855,20 +855,20 @@ 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 (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",
               _spec),
              trackingURI);
     NotifyBlockingDecision(aParentWindow, BlockingDecision::eBlock,
                            blockReason);
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);