Bug 1278762 - Support view source in RDM. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 26 Oct 2016 20:01:53 -0500
changeset 430089 09bca99dd66ee93affc9716328a418754a336fe2
parent 430088 2a85495a266905807ff734c05889b8f0d4e3e389
child 430090 41bbccca4106322a9f72b15099a5506530d41248
push id33735
push userbmo:jryans@gmail.com
push dateThu, 27 Oct 2016 05:52:32 +0000
reviewersochameau
bugs1278762
milestone52.0a1
Bug 1278762 - Support view source in RDM. r=ochameau MozReview-Commit-ID: 6RVynUTJ4qY
devtools/client/responsive.html/browser/tunnel.js
--- a/devtools/client/responsive.html/browser/tunnel.js
+++ b/devtools/client/responsive.html/browser/tunnel.js
@@ -104,16 +104,27 @@ function tunnelToInnerBrowser(outer, inn
             return outer[FRAME_LOADER];
           }
           return inner.frameLoader;
         },
         configurable: true,
         enumerable: true,
       });
 
+      // The `outerWindowID` of the content is used by browser actions like view source
+      // and print.  They send the ID down to the client to find the right content frame
+      // to act on.
+      Object.defineProperty(outer, "outerWindowID", {
+        get() {
+          return inner.outerWindowID;
+        },
+        configurable: true,
+        enumerable: true,
+      });
+
       // The `permanentKey` property on a <xul:browser> is used to index into various maps
       // held by the session store.  When you swap content around with
       // `_swapBrowserDocShells`, these keys are also swapped so they follow the content.
       // This means the key that matches the content is on the inner browser.  Since we
       // want the browser UI to believe the page content is part of the outer browser, we
       // copy the content's `permanentKey` up to the outer browser.
       copyPermanentKey(outer, inner);
 
@@ -269,16 +280,17 @@ function tunnelToInnerBrowser(outer, inn
       mmTunnel.destroy();
       mmTunnel = null;
 
       // 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.frameLoader;
       delete outer[FRAME_LOADER];
+      delete outer.outerWindowID;
 
       // 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" };
 
       browserWindow = null;
       gBrowser = null;