Bug 1371618 Pop-ups not displayed if never show checkbox left unmarked r=johannh,petru a=jcristau
authorAndrei Lazar <andrei.a.lazar@softvision.ro>
Wed, 29 May 2019 09:46:39 +0000
changeset 536565 250fc068195338d7430f2c82483bbda726f44421
parent 536564 8a7a40a3e59fea2d5046926f727249eebfc1e003
child 536566 ead433b4f740d1de53ab55b9196900eba788b1f1
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, petru, jcristau
bugs1371618
milestone68.0
Bug 1371618 Pop-ups not displayed if never show checkbox left unmarked r=johannh,petru a=jcristau Added the missing data to the UpdateBlockedPopups event fired from PopupBlockingChild component. Differential Revision: https://phabricator.services.mozilla.com/D31228
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -5394,42 +5394,45 @@ var PopupBlockerObserver = {
     }
   },
 
   allowPopupsForSite: function allowPopupsForSite(aAllow) {
     let currentURI = BrowserApp.selectedBrowser.currentURI;
     Services.perms.add(currentURI, "popup", aAllow
                        ? Ci.nsIPermissionManager.ALLOW_ACTION
                        : Ci.nsIPermissionManager.DENY_ACTION);
-    dump("Allowing popups for: " + currentURI);
   },
 
   showPopupsForSite: function showPopupsForSite() {
     let uri = BrowserApp.selectedBrowser.currentURI;
-    let {blockedPopups} = BrowserApp.selectedBrowser;
-    if (blockedPopups) {
-      for (let i = 0; i < blockedPopups.length; ++i) {
-        let popupURIspec = blockedPopups[i].popupWindowURIspec;
-
-        // Sometimes the popup URI that we get back from blockedPopups
-        // isn't useful (for instance, netscape.com's popup URI ends up
-        // being "http://www.netscape.com", which isn't really the URI of
-        // the popup they're trying to show).  This isn't going to be
-        // useful to the user, so we won't create a menu item for it.
-        if (popupURIspec == "" || popupURIspec == "about:blank" || popupURIspec == uri.spec)
-          continue;
-
-        let popupFeatures = blockedPopups[i].popupWindowFeatures;
-        let popupName = blockedPopups[i].popupWindowName;
-
-        let parent = BrowserApp.selectedTab;
-        let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(parent.browser);
-        BrowserApp.addTab(popupURIspec, { parentId: parent.id, isPrivate: isPrivate });
-      }
-    }
+    BrowserApp.selectedBrowser.retrieveListOfBlockedPopups().then(blockedPopups => {
+      if (blockedPopups) {
+        for (let i = 0; i < blockedPopups.length; ++i) {
+          let popupURIspec = blockedPopups[i].popupWindowURIspec;
+
+          // Sometimes the popup URI that we get back from blockedPopups
+          // isn't useful (for instance, netscape.com's popup URI ends up
+          // being "http://www.netscape.com", which isn't really the URI of
+          // the popup they're trying to show).  This isn't going to be
+          // useful to the user, so we won't create a menu item for it.
+          if (popupURIspec == "" || popupURIspec == "about:blank" || popupURIspec == uri.spec)
+            continue;
+
+          let popupFeatures = blockedPopups[i].popupWindowFeatures;
+          let popupName = blockedPopups[i].popupWindowName;
+
+          let parent = BrowserApp.selectedTab;
+          let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(parent.browser);
+          BrowserApp.addTab(popupURIspec, {
+            parentId: parent.id,
+            isPrivate: isPrivate,
+          });
+        }
+      }
+    });
   },
 };
 
 
 var IndexedDB = {
   _permissionsPrompt: "indexedDB-permissions-prompt",
   _permissionsResponse: "indexedDB-permissions-response",