Bug 1401288 - Run remote devtools panel browsers in the right TabGroup. r=aswan
authorLuca Greco <lgreco@mozilla.com>
Tue, 19 Sep 2017 20:06:02 +0200
changeset 381811 3e84d38ad0b4c7dd46b73663094895fe76f088fe
parent 381810 ffddadd962f2abdefb81b2252cc49911b33a8e89
child 381812 f8408a832d3514aa8d88d43ce26b138a52919a04
push id51607
push userluca.greco@alcacoop.it
push dateTue, 19 Sep 2017 23:21:47 +0000
treeherderautoland@3e84d38ad0b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1401288
milestone57.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 1401288 - Run remote devtools panel browsers in the right TabGroup. r=aswan This patch ensures that the devtools panel browser elements are associated to the same TabGroup of the other extension pages from the same extension. MozReview-Commit-ID: 40TSPqGfTnz
browser/components/extensions/ext-devtools-panels.js
--- a/browser/components/extensions/ext-devtools-panels.js
+++ b/browser/components/extensions/ext-devtools-panels.js
@@ -208,31 +208,34 @@ class ParentDevToolsPanel {
     this.context = null;
     this.toolbox = null;
     this.browser = null;
     this.browserContainerWindow = null;
   }
 
   createBrowserElement(window) {
     const {toolbox} = this;
+    const {extension} = this.context;
     const {url} = this.panelOptions;
     const {document} = window;
 
     const browser = document.createElementNS(XUL_NS, "browser");
     browser.setAttribute("type", "content");
     browser.setAttribute("disableglobalhistory", "true");
     browser.setAttribute("style", "width: 100%; height: 100%;");
     browser.setAttribute("transparent", "true");
     browser.setAttribute("class", "webextension-devtoolsPanel-browser");
     browser.setAttribute("webextension-view-type", "devtools_panel");
     browser.setAttribute("flex", "1");
 
-    this.browser = browser;
+    // Ensure that the devtools panel browser is going to run in the same
+    // process of the other extension pages from the same addon.
+    browser.sameProcessAsFrameLoader = extension.groupFrameLoader;
 
-    const {extension} = this.context;
+    this.browser = browser;
 
     let awaitFrameLoader = Promise.resolve();
     if (extension.remote) {
       browser.setAttribute("remote", "true");
       browser.setAttribute("remoteType", E10SUtils.EXTENSION_REMOTE_TYPE);
       awaitFrameLoader = promiseEvent(browser, "XULFrameLoaderCreated");
     }