Bug 1382968 - Flag Browser Console target as being chrome and related to a TabActor. r=jryans draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 07 Aug 2017 18:47:20 +0200
changeset 643439 abefb8ceca8f
parent 643438 97c88e1da683
child 643440 40ac077a4f6d
push id73100
push userbmo:poirot.alex@gmail.com
push dateWed, 09 Aug 2017 18:59:59 +0000
reviewersjryans
bugs1382968
milestone57.0a1
Bug 1382968 - Flag Browser Console target as being chrome and related to a TabActor. r=jryans The Browser Console interacts with a ChromeActor instance, which as any TabActor inherited actor, expects to be "attached" by calling its `attach` request. isTabActor set to true ensures that. While chrome set to true allows client codebase to enable additional behavior for chrome debugging. MozReview-Commit-ID: 1MVLBKnluhg
devtools/client/webconsole/hudservice.js
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -185,19 +185,18 @@ HUD_SERVICE.prototype =
         DebuggerServer.addBrowserActors();
       }
       DebuggerServer.allowChromeProcess = true;
 
       let client = new DebuggerClient(DebuggerServer.connectPipe());
       return client.connect()
         .then(() => client.getProcess())
         .then(aResponse => {
-          // Set chrome:false in order to attach to the target
-          // (i.e. send an `attach` request to the chrome actor)
-          return { form: aResponse.form, client: client, chrome: false };
+          // Use a TabActor in order to ensure calling `attach` to the ChromeActor
+          return { form: aResponse.form, client, chrome: true, isTabActor: true };
         });
     }
 
     let target;
     function getTarget(aConnection)
     {
       return TargetFactory.forRemoteTab(aConnection);
     }