Bug 739757 - (Part 4) Update popup blocked notifications. r=mfinkle

This commit is contained in:
Margaret Leibovic 2013-03-06 13:02:39 +00:00
parent 4160f0c856
commit 9c6c8ba4ca
2 changed files with 21 additions and 19 deletions

View File

@ -5622,30 +5622,32 @@ var PopupBlockerObserver = {
let strings = Strings.browser; let strings = Strings.browser;
if (popupCount > 1) if (popupCount > 1)
message = strings.formatStringFromName("popupWarningMultiple", [brandShortName, popupCount], 2); message = strings.formatStringFromName("popup.warningMultiple", [brandShortName, popupCount], 2);
else else
message = strings.formatStringFromName("popupWarning", [brandShortName], 1); message = strings.formatStringFromName("popup.warning", [brandShortName], 1);
let buttons = [ let buttons = [
{ {
label: strings.GetStringFromName("popupButtonAllowOnce"), label: strings.GetStringFromName("popup.show"),
callback: function() { PopupBlockerObserver.showPopupsForSite(); } callback: function(aChecked) {
},
{
label: strings.GetStringFromName("popupButtonAlwaysAllow2"),
callback: function() {
// Set permission before opening popup windows // Set permission before opening popup windows
PopupBlockerObserver.allowPopupsForSite(true); if (aChecked)
PopupBlockerObserver.allowPopupsForSite(true);
PopupBlockerObserver.showPopupsForSite(); PopupBlockerObserver.showPopupsForSite();
} }
}, },
{ {
label: strings.GetStringFromName("popupButtonNeverWarn2"), label: strings.GetStringFromName("popup.dontShow"),
callback: function() { PopupBlockerObserver.allowPopupsForSite(false); } callback: function(aChecked) {
if (aChecked)
PopupBlockerObserver.allowPopupsForSite(false);
}
} }
]; ];
NativeWindow.doorhanger.show(message, "popup-blocked", buttons); let options = { checkbox: Strings.browser.GetStringFromName("popup.dontAskAgain") };
NativeWindow.doorhanger.show(message, "popup-blocked", buttons, null, options);
} }
// Record the fact that we've reported this blocked popup, so we don't // Record the fact that we've reported this blocked popup, so we don't
// show it again. // show it again.
@ -6411,8 +6413,8 @@ var PermissionsHelper = {
}, },
"popup": { "popup": {
label: "blockPopups.label", label: "blockPopups.label",
allowed: "popupButtonAlwaysAllow2", allowed: "popup.show",
denied: "popupButtonNeverWarn2" denied: "popup.dontShow"
}, },
"indexedDB": { "indexedDB": {
label: "offlineApps.storeOfflineData", label: "offlineApps.storeOfflineData",

View File

@ -48,11 +48,11 @@ notificationRestart.blocked=Unsafe add-ons installed. Restart to disable.
notificationRestart.button=Restart notificationRestart.button=Restart
# Popup Blocker # Popup Blocker
popupWarning=%S prevented this site from opening a pop-up window. popup.warning=%S prevented this site from opening a pop-up window. Would you like to show it?
popupWarningMultiple=%S prevented this site from opening %S pop-up windows. popup.warningMultiple=%S prevented this site from opening %S pop-up windows. Would you like to show them?
popupButtonAllowOnce=Show popup.dontAskAgain=Don't ask again for this site
popupButtonAlwaysAllow2=Always Show popup.show=Show
popupButtonNeverWarn2=Never Show popup.dontShow=Don't show
# SafeBrowsing # SafeBrowsing
safeBrowsingDoorhanger=This site has been identified as containing malware or a phishing attempt. Be careful. safeBrowsingDoorhanger=This site has been identified as containing malware or a phishing attempt. Be careful.