bug 1380818 show the add-on id on about:debugging r=jdescottes
authorAndy McKay <amckay@mozilla.com>
Sat, 15 Jul 2017 07:47:05 -0700
changeset 369195 1dd2fccddf1fdf047af6a8b3e0bf1028ad68749b
parent 369194 28409af996ff011c5b1ef699e38da5fda26a2735
child 369196 983924a5bc562ff2ed3c7340a3714f37eecf9976
push id46595
push userryanvm@gmail.com
push dateMon, 17 Jul 2017 18:04:58 +0000
treeherderautoland@1dd2fccddf1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1380818
milestone56.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 1380818 show the add-on id on about:debugging r=jdescottes MozReview-Commit-ID: D1K0LgLX34S
devtools/client/aboutdebugging/components/addons/target.js
devtools/client/aboutdebugging/test/browser_addons_debug_info.js
devtools/client/locales/en-US/aboutdebugging.properties
--- a/devtools/client/aboutdebugging/components/addons/target.js
+++ b/devtools/client/aboutdebugging/components/addons/target.js
@@ -38,16 +38,32 @@ function filePathForTarget(target) {
     // the ellipsis on the left.
     dom.dd(
       { className: "addon-target-info-content file-path" },
       dom.span({ className: "file-path-inner", title: path }, path),
     ),
   ];
 }
 
+function addonIDforTarget(target) {
+  return [
+    dom.dt(
+      { className: "addon-target-info-label" },
+      Strings.GetStringFromName("extensionID"),
+    ),
+    dom.dd(
+      { className: "addon-target-info-content extension-id" },
+      dom.span(
+        { title: target.addonID },
+        target.addonID
+      )
+    ),
+  ];
+}
+
 function internalIDForTarget(target) {
   if (!target.manifestURL) {
     return [];
   }
   // Strip off the protocol and rest, leaving us with just the UUID.
   let uuid = /moz-extension:\/\/([^/]*)/.exec(target.manifestURL)[1];
   return [
     dom.dt(
@@ -158,16 +174,17 @@ module.exports = createClass({
           src: target.icon
         }),
         dom.span({ className: "target-name", title: target.name }, target.name)
       ),
       showMessages(target),
       dom.dl(
         { className: "addon-target-info" },
         ...filePathForTarget(target),
+        ...addonIDforTarget(target),
         ...internalIDForTarget(target),
       ),
       dom.div({className: "addon-target-actions"},
         dom.button({
           className: "debug-button addon-target-button",
           onClick: this.debug,
           disabled: debugDisabled,
         }, Strings.GetStringFromName("debug")),
--- a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
+++ b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
@@ -41,16 +41,19 @@ add_task(function* testWebExtension() {
     path: "addons/test-devtools-webextension-nobg/manifest.json",
     name: addonName,
     isWebExtension: true
   });
 
   let container = document.querySelector(`[data-addon-id="${addonId}"]`);
   testFilePath(container, "/test/addons/test-devtools-webextension-nobg/");
 
+  let extensionID = container.querySelector(".extension-id span");
+  ok(extensionID.textContent === "test-devtools-webextension-nobg@mozilla.org");
+
   let internalUUID = container.querySelector(".internal-uuid span");
   ok(internalUUID.textContent.match(UUID_REGEX), "internalUUID is correct");
 
   let manifestURL = container.querySelector(".manifest-url");
   ok(manifestURL.href.startsWith("moz-extension://"), "href for manifestURL exists");
 
   yield uninstallAddon({document, id: addonId, name: addonName});
 
@@ -69,16 +72,19 @@ add_task(function* testTemporaryWebExten
     isWebExtension: true
   });
 
   let addons = document.querySelectorAll("#temporary-extensions .addon-target-container");
   // Assuming that our temporary add-on is now at the top.
   let container = addons[addons.length - 1];
   let addonId = container.dataset.addonId;
 
+  let extensionID = container.querySelector(".extension-id span");
+  ok(extensionID.textContent.endsWith("@temporary-addon"));
+
   let temporaryID = container.querySelector(".temporary-id-url");
   ok(temporaryID, "Temporary ID message does appear");
 
   yield uninstallAddon({document, id: addonId, name: addonName});
 
   yield closeAboutDebugging(tab);
 });
 
--- a/devtools/client/locales/en-US/aboutdebugging.properties
+++ b/devtools/client/locales/en-US/aboutdebugging.properties
@@ -71,16 +71,20 @@ extensions = Extensions
 # This string is displayed as a header above the list of temporarily loaded add-ons.
 temporaryExtensions = Temporary Extensions
 
 # LOCALIZATION NOTE (internalUUID):
 # This string is displayed as a label for the internal UUID of an extension.
 # The UUID is generated for this profile on install.
 internalUUID = Internal UUID
 
+# LOCALIZATION NOTE (extensionID):
+# This string is displayed as a label for the ID of an extension. This is not the same as the internal UUID.
+extensionID = Extension ID
+
 # LOCALIZATION NOTE (manifestURL):
 # This string is displayed as a link for the manifest of an extension,
 # accessible in a browser, such as moz-extension://[internalUUID]/manifest.json.
 manifestURL = Manifest URL
 
 # LOCALIZATION NOTE (webExtTip):
 # This string is displayed as a message below the list of temporarily loaded add-ons.
 # Web-ext is a command line tool for web-extensions developers.