--- a/dom/notification/old/NotificationDB.jsm
+++ b/dom/notification/old/NotificationDB.jsm
@@ -70,36 +70,37 @@ var NotificationDB = {
if (aTopic == "xpcom-shutdown") {
this._shutdownInProgress = true;
Services.obs.removeObserver(this, "xpcom-shutdown");
this.unregisterListeners();
}
},
filterNonAppNotifications(notifications) {
+ let result = Object.create(null);
for (let origin in notifications) {
+ result[origin] = Object.create(null);
let persistentNotificationCount = 0;
for (let id in notifications[origin]) {
if (notifications[origin][id].serviceWorkerRegistrationScope) {
persistentNotificationCount++;
- } else {
- delete notifications[origin][id];
+ result[origin][id] = notifications[origin][id];
}
}
if (persistentNotificationCount == 0) {
if (DEBUG) {
debug(
"Origin " + origin + " is not linked to an app manifest, deleting."
);
}
- delete notifications[origin];
+ delete result[origin];
}
}
- return notifications;
+ return result;
},
// Attempt to read notification file, if it's not there we will create it.
load() {
var promise = OS.File.read(NOTIFICATION_STORE_PATH, { encoding: "utf-8" });
return promise.then(
data => {
if (data.length > 0) {