Bug 1278762 - Support view source in RDM. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 26 Oct 2016 20:01:53 -0500
changeset 319800 b8ee6ceb5e6e50d075e8c6b550fa9dd6f67c90ff
parent 319799 4507a959d08b54291b2a070dc8dff6a89ef9429d
child 319801 a87bd4b96744c8db0fc14ae18acfea09a81705c4
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;