bug 1551188: remote: print listening address similarly to chrome; r=remote-protocol-reviewers,ochameau
authorAndreas Tolfsen <ato@sny.no>
Mon, 13 May 2019 14:43:21 +0000
changeset 535496 96e678846de742425e0f48cbea15bad6731160f4
parent 535495 abaf133a405518a1c014b704c4fe72dc27a018c1
child 535497 04b9eaf2e4391fa9e0cc9b70b875b4c7628b8c82
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-protocol-reviewers, ochameau
bugs1551188
milestone68.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 1551188: remote: print listening address similarly to chrome; r=remote-protocol-reviewers,ochameau Puppeteer parses stderr looking for the regular expression ^DevTools listening on (ws:\/\/.*)$. For Puppeteer to be able to connect to Firefox, we need to change the line we print slightly to conform with this expression. The remote agent also uses Log.jsm to print it, but we cannot rely on logging always being enabled, e.g. if remote.log.level is set to Warn or above. For this reason we should use dump(). The patch also instantiates the main target before starting the HTTPD. Differential Revision: https://phabricator.services.mozilla.com/D30913
remote/RemoteAgent.jsm
--- a/remote/RemoteAgent.jsm
+++ b/remote/RemoteAgent.jsm
@@ -90,22 +90,22 @@ class RemoteAgentClass {
       return;
     }
 
     this.init();
 
     await this.tabs.start();
 
     try {
-      this.server._start(port, host);
-
       // Immediatly instantiate the main process target in order
       // to be accessible via HTTP endpoint on startup
       const mainTarget = this.targets.getMainProcessTarget();
-      log.info(`Remote debugging agent listening on ${mainTarget.wsDebuggerURL}`);
+
+      this.server._start(port, host);
+      dump(`DevTools listening on ${mainTarget.wsDebuggerURL}`);
     } catch (e) {
       throw new Error(`Unable to start remote agent: ${e.message}`, e);
     }
 
     Preferences.set(RecommendedPreferences);
   }
 
   async close() {