Bug 1054840 - Ignore popups shown during onunload. r=felipe, a=sledru
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 19 Aug 2014 17:24:21 -0700
changeset 217591 d3ff71d97d365dc49ef2bf0f555e578eea7634b5
parent 217590 559fe257d838798a0e5c042d71b7beb1bba656ea
child 217592 ea8bdfa3821f9245b6e834a840f39a3bc7b8fa72
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, sledru
bugs1054840
milestone33.0a2
Bug 1054840 - Ignore popups shown during onunload. r=felipe, a=sledru
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -431,16 +431,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