support about:debugging#tabs when connected to a remote instance draft
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 10 Oct 2016 15:42:56 +0200
changeset 423210 1475321735339c16ffb2af1cdd0a4c19b566994f
parent 423209 517027eecf69f3f72218e815c22f5528e9681fff
child 533380 efdbc206fa2a82ab3690e882be27b17208e7a54c
push id31821
push userjdescottes@mozilla.com
push dateMon, 10 Oct 2016 13:43:54 +0000
milestone52.0a1
support about:debugging#tabs when connected to a remote instance MozReview-Commit-ID: LJEIUR4xi0d
devtools/client/aboutdebugging/components/tabs/target.js
--- a/devtools/client/aboutdebugging/components/tabs/target.js
+++ b/devtools/client/aboutdebugging/components/tabs/target.js
@@ -13,17 +13,27 @@ const Services = require("Services");
 const Strings = Services.strings.createBundle(
   "chrome://devtools/locale/aboutdebugging.properties");
 
 module.exports = createClass({
   displayName: "TabTarget",
 
   debug() {
     let { target } = this.props;
-    window.open("about:devtools-toolbox?type=tab&id=" + target.outerWindowID);
+    let id = target.outerWindowID;
+    let toolboxUrl = "about:devtools-toolbox?type=tab&id=" + id;
+
+    let url = new window.URL(window.location.href.replace("about:", "http://"));
+    let host = url.searchParams.get("host");
+    let port = url.searchParams.get("port");
+    if (host && port) {
+      toolboxUrl += `&host=${host}&port=${port}`;
+    }
+
+    window.open(toolboxUrl);
   },
 
   render() {
     let { target } = this.props;
 
     return dom.div({ className: "target-container" },
       dom.img({
         className: "target-icon",