Bug 1054840 - Ignore popups shown during onunload (r=felipe)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 19 Aug 2014 17:24:21 -0700
changeset 214802 43167be718643af58b0c3ed45e4aa311e73e1279
parent 214801 01a1476ba31bb1f496f6e47442d129007cb4abdd
child 214803 1f8622ef4253ee6f60d0cfef595c9d0cb20bcd51
push idunknown
push userunknown
push dateunknown
reviewersfelipe
bugs1054840
milestone34.0a1
Bug 1054840 - Ignore popups shown during onunload (r=felipe)
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -433,16 +433,23 @@ var gPopupBlockerObserver = {
 
     if (!this._reportButton && gURLBar)
       this._reportButton = document.getElementById("page-report-button");
 
     if (!gBrowser.selectedBrowser.blockedPopups) {
       // Hide the icon in the location bar (if the location bar exists)
       if (gURLBar)
         this._reportButton.hidden = true;
+
+      // Hide the notification box (if it's visible).
+      var notificationBox = gBrowser.getNotificationBox();
+      var notification = notificationBox.getNotificationWithValue("popup-blocked");
+      if (notification) {
+        notificationBox.removeNotification(notification, false);
+      }
       return;
     }
 
     if (gURLBar)
       this._reportButton.hidden = false;
 
     // Only show the notification again if we've not already shown it. Since
     // notifications are per-browser, we don't need to worry about re-adding