Bug 1924095 - Don't regenerate backups when cookies are removed by the site. r=backup-reviewers,sthompson

Differential Revision: https://phabricator.services.mozilla.com/D227865
This commit is contained in:
Mike Conley
2024-11-06 21:18:18 +00:00
parent 975fd89f6c
commit 3bb69687fc
2 changed files with 44 additions and 2 deletions

View File

@@ -3326,9 +3326,14 @@ export class BackupService extends EventTarget {
// Intentional fall-through
case "session-cookie-changed": {
let notification = subject.QueryInterface(Ci.nsICookieNotification);
// A browsingContextId value of 0 means that this deletion was caused by
// chrome UI cookie deletion, which is what we care about. If it's not
// 0, then a site deleted its own cookie, which we ignore.
if (
notification.action == Ci.nsICookieNotification.COOKIE_DELETED ||
notification.action == Ci.nsICookieNotification.ALL_COOKIES_CLEARED
(notification.action == Ci.nsICookieNotification.COOKIE_DELETED ||
notification.action ==
Ci.nsICookieNotification.ALL_COOKIES_CLEARED) &&
!notification.browsingContextId
) {
this.#debounceRegeneration();
}