Bug 628041 refresh the install blocked panel text r=flod,aswan

Differential Revision: https://phabricator.services.mozilla.com/D25881

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Shane Caraveo 2019-04-10 20:50:13 +00:00
Родитель d254b36f8f
Коммит 4f56dd2049
3 изменённых файлов: 41 добавлений и 7 удалений

Просмотреть файл

@ -414,13 +414,32 @@ var gXPInstallObserver = {
removeNotificationOnEnd(popup, installInfo.installs);
break; }
case "addon-install-blocked": {
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
[brandShortName]);
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage.header", ["<>"]);
options.name = options.displayURI.displayHost;
// displayURI becomes it's own label, so we unset it for this panel. It will become part of the
// messageString above.
options.displayURI = undefined;
options.eventCallback = (topic) => {
if (topic !== "showing") {
return;
}
let doc = browser.ownerDocument;
let message = doc.getElementById("addon-install-blocked-message");
let text = gNavigatorBundle.getString("xpinstallPromptMessage.message");
let b = doc.createElementNS("http://www.w3.org/1999/xhtml", "b");
b.textContent = options.name;
let fragment = BrowserUtils.getLocalizedFragment(doc, text, b);
message.appendChild(fragment);
let learnMore = doc.getElementById("addon-install-blocked-info");
learnMore.textContent = gNavigatorBundle.getString("xpinstallPromptMessage.learnMore");
learnMore.setAttribute("href", Services.urlFormatter.formatURLPref("app.support.baseURL") + "unlisted-extensions-risks");
};
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
action = {
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
label: gNavigatorBundle.getString("xpinstallPromptMessage.install"),
accessKey: gNavigatorBundle.getString("xpinstallPromptMessage.install.accesskey"),
callback() {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED_CLICK_THROUGH);
installInfo.install();

Просмотреть файл

@ -83,6 +83,15 @@
</popupnotificationcontent>
</popupnotification>
<popupnotification id="addon-install-blocked-notification" hidden="true">
<popupnotificationcontent id="addon-install-blocked-content" orient="vertical">
<description id="addon-install-blocked-message" class="popup-notification-description"></description>
<hbox>
<label id="addon-install-blocked-info" class="popup-notification-learnmore-link" is="text-link"/>
</hbox>
</popupnotificationcontent>
</popupnotification>
<popupnotification id="contextual-feature-recommendation-notification" hidden="true">
<popupnotificationheader id="cfr-notification-header">
<stack id="cfr-notification-header-stack">

Просмотреть файл

@ -21,13 +21,19 @@ contextMenuSearch.accesskey=S
bookmarkAllTabsDefault=[Folder Name]
xpinstallPromptMessage=%S prevented this site from asking you to install software on your computer.
# LOCALIZATION NOTE (xpinstallPromptMessage.header)
# The string contains the hostname of the site the add-on is being installed from.
xpinstallPromptMessage.header=Allow %S to install an add-on?
xpinstallPromptMessage.message=You are attempting to install an add-on from %S. Make sure you trust this site before continuing.
xpinstallPromptMessage.learnMore=Learn more about installing add-ons safely
xpinstallPromptMessage.dontAllow=Dont Allow
xpinstallPromptMessage.dontAllow.accesskey=D
xpinstallPromptAllowButton=Allow
# Accessibility Note:
# Be sure you do not choose an accesskey that is used elsewhere in the active context (e.g. main menu bar, submenu of the warning popup button)
# See http://www.mozilla.org/access/keyboard/accesskey for details
xpinstallPromptAllowButton.accesskey=A
# See https://website-archive.mozilla.org/www.mozilla.org/access/access/keyboard/ for details
xpinstallPromptMessage.install=Continue to Installation
xpinstallPromptMessage.install.accesskey=C
xpinstallDisabledMessageLocked=Software installation has been disabled by your system administrator.
xpinstallDisabledMessage=Software installation is currently disabled. Click Enable and try again.
xpinstallDisabledButton=Enable