From dc2475042e21d15d07aed71834da215d7c4aac3b Mon Sep 17 00:00:00 2001 From: Andy McKay Date: Sat, 15 Jul 2017 07:47:05 -0700 Subject: [PATCH] bug 1380818 show the add-on id on about:debugging r=jdescottes MozReview-Commit-ID: D1K0LgLX34S --HG-- extra : rebase_source : dd6304091fb65e5bf211ab401d70bba0970cd03f --- .../aboutdebugging/components/addons/target.js | 17 +++++++++++++++++ .../test/browser_addons_debug_info.js | 6 ++++++ .../locales/en-US/aboutdebugging.properties | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/devtools/client/aboutdebugging/components/addons/target.js b/devtools/client/aboutdebugging/components/addons/target.js index 6c7f0cd2e2de..15e271b2d2db 100644 --- a/devtools/client/aboutdebugging/components/addons/target.js +++ b/devtools/client/aboutdebugging/components/addons/target.js @@ -43,6 +43,22 @@ function filePathForTarget(target) { ]; } +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 []; @@ -163,6 +179,7 @@ module.exports = createClass({ dom.dl( { className: "addon-target-info" }, ...filePathForTarget(target), + ...addonIDforTarget(target), ...internalIDForTarget(target), ), dom.div({className: "addon-target-actions"}, diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js index 687534d4f705..28c03cd5a657 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js +++ b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js @@ -46,6 +46,9 @@ add_task(function* testWebExtension() { 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"); @@ -74,6 +77,9 @@ add_task(function* testTemporaryWebExtension() { 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"); diff --git a/devtools/client/locales/en-US/aboutdebugging.properties b/devtools/client/locales/en-US/aboutdebugging.properties index 90d23ec63734..b276c84dbc4e 100644 --- a/devtools/client/locales/en-US/aboutdebugging.properties +++ b/devtools/client/locales/en-US/aboutdebugging.properties @@ -76,6 +76,10 @@ temporaryExtensions = Temporary Extensions # 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.