bug 1594351: toolkit: include remote protocol section in about:support; r=remote-protocol-reviewers,fluent-reviewers,Gijs,flod,maja_zf
authorAndreas Tolfsen <ato@sny.no>
Thu, 14 Nov 2019 13:32:41 +0000
changeset 501928 a19a226a8c6aa2cb57765c13752057d42a177df9
parent 501927 83567a7a58738b1dcdb5ed64ec41c016a4339160
child 501929 1dc82629b31eca44d1f0d318ba358aa5fce6aa79
child 502036 173de3ea2a270d6dd2c117a291460093d4c168ec
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-protocol-reviewers, fluent-reviewers, Gijs, flod, maja_zf
bugs1594351
milestone72.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 1594351: toolkit: include remote protocol section in about:support; r=remote-protocol-reviewers,fluent-reviewers,Gijs,flod,maja_zf This adds a new section at the bottom of about:support to show the current status of the CDP-based remote agent service. This section will display useful troubleshooting information regarding the remote agent. The remote agent is a forthcoming low-level RPC protocol providing debugging interfaces for Gecko internals. Because it exposes browser-internals to the surrounding system we need a clear way for the user to find if it is listening for browser-external connections. The table, entitled "Remote Debugging (Chromium Protocol)", contains the following new information: Accepting connections whether the HTTPD is listening for incoming connections URL connection endpoint for clients Differential Revision: https://phabricator.services.mozilla.com/D52359
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -922,16 +922,24 @@ var snapshotFormatters = {
     // Media Capabilitites
     insertEnumerateDatabase();
   },
 
   javaScript(data) {
     $("javascript-incremental-gc").textContent = data.incrementalGCEnabled;
   },
 
+  remoteAgent(data) {
+    if (!AppConstants.ENABLE_REMOTE_AGENT) {
+      return;
+    }
+    $("remote-debugging-accepting-connections").textContent = data.listening;
+    $("remote-debugging-url").textContent = data.url;
+  },
+
   accessibility(data) {
     $("a11y-activated").textContent = data.isActive;
     $("a11y-force-disabled").textContent = data.forceDisabled || 0;
 
     let a11yHandlerUsed = $("a11y-handler-used");
     if (a11yHandlerUsed) {
       a11yHandlerUsed.textContent = data.handlerUsed;
     }
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -652,15 +652,33 @@
           </tr>
           <tr>
             <th class="column" data-l10n-id="intl-regional-prefs"/>
             <td id="intl-osprefs-regionalprefs">
             </td>
           </tr>
         </tbody>
       </table>
+
       <!-- - - - - - - - - - - - - - - - - - - - - -->
 
+#if defined(ENABLE_REMOTE_AGENT)
+      <h2 class="major-section" data-l10n-id="remote-debugging-title"/>
+
+      <table>
+        <tbody>
+          <tr>
+            <th class="column" data-l10n-id="remote-debugging-accepting-connections"/>
+            <td id="remote-debugging-accepting-connections"></td>
+          </tr>
+          <tr>
+            <th class="column" data-l10n-id="remote-debugging-url"/>
+            <td id="remote-debugging-url"></td>
+          </tr>
+        </tbody>
+      </table>
+#endif
+
     </div>
 
   </body>
 
 </html>
--- a/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
@@ -145,16 +145,30 @@ intl-app-title = Application Settings
 intl-locales-requested = Requested Locales
 intl-locales-available = Available Locales
 intl-locales-supported = App Locales
 intl-locales-default = Default Locale
 intl-os-title = Operating System
 intl-os-prefs-system-locales = System Locales
 intl-regional-prefs = Regional Preferences
 
+## Remote Debugging
+##
+## The Firefox remote protocol provides low-level debugging interfaces
+## used to inspect state and control execution of documents,
+## browser instrumentation, user interaction simulation,
+## and for subscribing to browser-internal events.
+##
+## See also https://firefox-source-docs.mozilla.org/remote/
+
+remote-debugging-title = Remote Debugging (Chromium Protocol)
+remote-debugging-accepting-connections = Accepting Connections
+remote-debugging-url = URL
+##
+
 # Variables
 # $days (Integer) - Number of days of crashes to log
 report-crash-for-days =
     { $days ->
         [one] Crash Reports for the Last { $days } Day
        *[other] Crash Reports for the Last { $days } Days
     }
 
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -816,8 +816,22 @@ if (AppConstants.MOZ_SANDBOX) {
       );
       data.effectiveContentSandboxLevel =
         sandboxSettings.effectiveContentSandboxLevel;
     }
 
     done(data);
   };
 }
+
+if (AppConstants.ENABLE_REMOTE_AGENT) {
+  dataProviders.remoteAgent = function remoteAgent(done) {
+    const { RemoteAgent } = ChromeUtils.import(
+      "chrome://remote/content/RemoteAgent.jsm"
+    );
+    const { listening, scheme, host, port } = RemoteAgent;
+    let url = "";
+    if (listening) {
+      url = `${scheme}://${host}:${port}/`;
+    }
+    done({ listening, url });
+  };
+}
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -858,16 +858,29 @@ const SNAPSHOT_SCHEMA = {
             regionalPrefsLocales: {
               required: true,
               type: "array",
             },
           },
         },
       },
     },
+    remoteAgent: {
+      type: "object",
+      properties: {
+        listening: {
+          required: true,
+          type: "boolean",
+        },
+        url: {
+          required: true,
+          type: "string",
+        },
+      },
+    },
   },
 };
 
 /**
  * Throws an Error if obj doesn't conform to schema.  That way you get a nice
  * error message and a stack to help you figure out what went wrong, which you
  * wouldn't get if this just returned true or false instead.  There's still
  * room for improvement in communicating validation failures, however.