From b0762593165da18bceabc5e542d5328e09476ffb Mon Sep 17 00:00:00 2001 From: Tim Huang Date: Thu, 23 Jul 2020 20:17:39 +0000 Subject: [PATCH] Bug 1643045 - Part 1: Enable cookie purging in cookie behavior 1 and 3. r=ewright Differential Revision: https://phabricator.services.mozilla.com/D84359 --- .../antitracking/PurgeTrackerService.jsm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/toolkit/components/antitracking/PurgeTrackerService.jsm b/toolkit/components/antitracking/PurgeTrackerService.jsm index f40ae60dfb45..998abafb72cf 100644 --- a/toolkit/components/antitracking/PurgeTrackerService.jsm +++ b/toolkit/components/antitracking/PurgeTrackerService.jsm @@ -287,17 +287,24 @@ PurgeTrackerService.prototype = { "privacy.purge_trackers.enabled", false ); - // Only purge if ETP is enabled. + + // Purge cookie jars for following cookie behaviors. + // * BEHAVIOR_REJECT_FOREIGN + // * BEHAVIOR_LIMIT_FOREIGN + // * BEHAVIOR_REJECT_TRACKER (ETP) + // * BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN (dFPI) let cookieBehavior = Services.cookies.cookieBehavior; - let etpActive = + let activeWithCookieBehavior = + cookieBehavior == Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN || + cookieBehavior == Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN || cookieBehavior == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER || cookieBehavior == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN; - if (!etpActive || !purgeEnabled) { + if (!activeWithCookieBehavior || !purgeEnabled) { logger.log( - `returning early, etpActive: ${etpActive}, purgeEnabled: ${purgeEnabled}` + `returning early, activeWithCookieBehavior: ${activeWithCookieBehavior}, purgeEnabled: ${purgeEnabled}` ); this.resetPurgeList(); return;