Bug 1278763 - Part 1: Add a PopupNotifications backend on the RDM browser, r=jryans
authorBenoit Chabod <bchabod@mozilla.com>
Wed, 10 Aug 2016 17:11:35 -0700
changeset 309157 356bb4c55f4dde7fae5f814208e1344ed74f20bd
parent 309156 deb1fab4b247d5cfec5654e6892c9407fdf21f99
child 309158 c4a79e57209adab8f38ca9ea9da8317bf748235a
push id31321
push userkwierso@gmail.com
push dateFri, 12 Aug 2016 23:30:18 +0000
treeherderautoland@c385cb6a0838 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1278763
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1278763 - Part 1: Add a PopupNotifications backend on the RDM browser, r=jryans
devtools/client/responsive.html/browser/tunnel.js
--- a/devtools/client/responsive.html/browser/tunnel.js
+++ b/devtools/client/responsive.html/browser/tunnel.js
@@ -175,16 +175,26 @@ function tunnelToInnerBrowser(outer, inn
         enumerable: true,
       });
 
       // Wants to access the content's `frameLoader`, so we'll redirect it to
       // inner browser.
       outer.setDocShellIsActiveAndForeground = value => {
         inner.frameLoader.tabParent.setDocShellIsActiveAndForeground(value);
       };
+
+      // Make the PopupNotifications object available on the iframe's owner
+      // This is used for permission doorhangers
+      Object.defineProperty(inner.ownerGlobal, "PopupNotifications", {
+        get() {
+          return outer.ownerGlobal.PopupNotifications;
+        },
+        configurable: true,
+        enumerable: true,
+      });
     }),
 
     stop() {
       let tab = gBrowser.getTabForBrowser(outer);
       let filteredProgressListener = gBrowser._tabFilters.get(tab);
       browserWindow = null;
       gBrowser = null;
 
@@ -205,16 +215,19 @@ function tunnelToInnerBrowser(outer, inn
       // Reset overridden XBL properties and methods.  Deleting the override
       // means it will fallback to the original XBL binding definitions which
       // are on the prototype.
       delete outer.isRemoteBrowser;
       delete outer.hasContentOpener;
       delete outer.docShellIsActive;
       delete outer.setDocShellIsActiveAndForeground;
 
+      // Delete the PopupNotifications getter added for permission doorhangers
+      delete inner.ownerGlobal.PopupNotifications;
+
       mmTunnel.destroy();
       mmTunnel = null;
 
       // Invalidate outer's permanentKey so that SessionStore stops associating
       // things that happen to the outer browser with the content inside in the
       // inner browser.
       outer.permanentKey = { id: "zombie" };
     },