Bug 1296252 - Part 1 - Only display doorhanger notifications when they are anchored to the right icon. r=johannh
MozReview-Commit-ID: 93nzbZ8jnQK
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -812,16 +812,20 @@ PopupNotifications.prototype = {
this._setNotificationUIState(notificationEl, notification.options.checkbox.uncheckedState);
}
},
_showPanel: function PopupNotifications_showPanel(notificationsToShow, anchorElement) {
this.panel.hidden = false;
notificationsToShow = notificationsToShow.filter(n => {
+ if (anchorElement != n.anchorElement) {
+ return false;
+ }
+
let dismiss = this._fireCallback(n, NOTIFICATION_EVENT_SHOWING);
if (dismiss)
n.dismissed = true;
return !dismiss;
});
if (!notificationsToShow.length)
return;
let notificationIds = notificationsToShow.map(n => n.id);