Bug 1434976 - Stop setting web-extension install prompt message details dynamically. r?johannh draft
authorPrathiksha <prathikshaprasadsuman@gmail.com>
Thu, 15 Feb 2018 18:44:29 +0530
changeset 756244 6d9152bf4973041d0c3e82834b459e9ee23ed00c
parent 755533 9b69cc60e5848f2f8802c911fd00771b50eed41f
push id99438
push userbmo:prathikshaprasadsuman@gmail.com
push dateFri, 16 Feb 2018 17:03:30 +0000
reviewersjohannh
bugs1434976
milestone60.0a1
Bug 1434976 - Stop setting web-extension install prompt message details dynamically. r?johannh MozReview-Commit-ID: GfewQFsgEAa
browser/base/content/popup-notifications.inc
browser/base/content/test/static/browser_misused_characters_in_strings.js
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/browser.properties
browser/modules/ExtensionsUI.jsm
--- a/browser/base/content/popup-notifications.inc
+++ b/browser/base/content/popup-notifications.inc
@@ -77,11 +77,11 @@
         <description id="addon-webext-perm-text" class="addon-webext-perm-text"/>
         <label id="addon-webext-perm-intro" class="addon-webext-perm-text"/>
         <html:ul id="addon-webext-perm-list" class="addon-webext-perm-list"/>
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="addon-installed-notification" hidden="true">
       <popupnotificationcontent class="addon-installed-notification-content" orient="vertical">
-        <description id="addon-installed-notification-message"/>
+        <description>&addonPostInstallMessage.label;</description>
       </popupnotificationcontent>
     </popupnotification>
--- a/browser/base/content/test/static/browser_misused_characters_in_strings.js
+++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js
@@ -143,16 +143,20 @@ let gWhitelist = [{
   }, {
     file: "aboutNetworking.dtd",
     key: "aboutNetworking.logTutorial",
     type: "single-quote"
   }, {
     file: "aboutdevtools.dtd",
     key: "aboutDevtools.newsletter.privacy.label",
     type: "single-quote"
+  }, {
+    file: "browser.dtd",
+    key: "addonPostInstallMessage.label",
+    type: "single-quote"
   }
 ];
 
 /**
  * Check if an error should be ignored due to matching one of the whitelist
  * objects defined in gWhitelist.
  *
  * @param filepath The URI spec of the locale file
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -988,8 +988,13 @@ you can use these alternative items. Oth
 
 <!ENTITY libraryButton.tooltip "View history, saved bookmarks, and more">
 
 <!-- LOCALIZATION NOTE: (accessibilityIndicator.tooltip): This is used to
      display a tooltip for accessibility indicator in toolbar/tabbar. It is also
      used as a textual label for the indicator used by assistive technology
      users. -->
 <!ENTITY accessibilityIndicator.tooltip "Accessibility Features Enabled">
+
+<!-- LOCALIZATION NOTE: (addonPostInstallMessage.label):
+     The first <image> tag is replaced with the icon for the add-ons menu.
+     The second <image> tag is replaced with the icon for the toolbar menu. -->
+<!ENTITY addonPostInstallMessage.label "Manage your add-ons by clicking <image class='addon-addon-icon'/> in the <image class='addon-toolbar-icon'/> menu.">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -157,22 +157,16 @@ webext.defaultSearchYes.accessKey=Y
 webext.defaultSearchNo.label=No
 webext.defaultSearchNo.accessKey=N
 
 # LOCALIZATION NOTE (addonPostInstall.message)
 # %1$S is replaced with the localized named of the extension that was
 # just installed.
 # %2$S is replaced with the localized name of the application.
 addonPostInstall.message1=%1$S has been added to %2$S.
-
-# LOCALIZATION NOTE (addonPostInstall.messageDetail)
-# %1$S is replaced with the icon for the add-ons menu.
-# %2$S is replaced with the icon for the toolbar menu.
-# Note, this string will be used as raw markup. Avoid characters like <, >, &
-addonPostInstall.messageDetail=Manage your add-ons by clicking %1$S in the %2$S menu.
 addonPostInstall.okay.label=OK
 addonPostInstall.okay.key=O
 
 # LOCALIZATION NOTE (addonDownloadingAndVerifying):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # Also see https://bugzilla.mozilla.org/show_bug.cgi?id=570012 for mockups
 addonDownloadingAndVerifying=Downloading and verifying add-on…;Downloading and verifying #1 add-ons…
--- a/browser/modules/ExtensionsUI.jsm
+++ b/browser/modules/ExtensionsUI.jsm
@@ -388,25 +388,19 @@ this.ExtensionsUI = {
                                   action, secondaryActions, popupOptions);
     });
   },
 
   showInstallNotification(target, addon) {
     let win = target.ownerGlobal;
     let popups = win.PopupNotifications;
 
-    let addonIcon = '<image class="addon-addon-icon"/>';
-    let toolbarIcon = '<image class="addon-toolbar-icon"/>';
-
     let brandBundle = win.document.getElementById("bundle_brand");
     let appName = brandBundle.getString("brandShortName");
-
     let bundle = win.gNavigatorBundle;
-    let msg2 = bundle.getFormattedString("addonPostInstall.messageDetail",
-                                         [addonIcon, toolbarIcon]);
 
     // Create the notification header element.
     let message = {};
     let header = bundle.getFormattedString("addonPostInstall.message1",
                                           ["<>", appName]);
     header = header.split("<>");
     message.start = header[0];
     // Use the host element to display addon name in addon permission prompts.
@@ -423,22 +417,17 @@ this.ExtensionsUI = {
       let icon = addon.isWebExtension ?
                  addon.iconURL || DEFAULT_EXTENSION_ICON :
                  "chrome://browser/skin/addons/addon-install-installed.svg";
       let options = {
         hideClose: true,
         timeout: Date.now() + 30000,
         popupIconURL: icon,
         eventCallback(topic) {
-          if (topic == "showing") {
-            let doc = this.browser.ownerDocument;
-            // eslint-disable-next-line no-unsanitized/property
-            doc.getElementById("addon-installed-notification-message")
-               .unsafeSetInnerHTML(msg2);
-          } else if (topic == "dismissed") {
+          if (topic == "dismissed") {
             resolve();
           }
         }
       };
 
       popups.show(target, "addon-installed", message, "addons-notification-icon",
                   action, null, options);
     });