Bug 1349841 - Don't show "Never For This Session" option in web notification permission prompts in PBM. r=johannh
MozReview-Commit-ID: CLUfqRubjZ9
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -492,17 +492,16 @@ geolocation.shareWithSite3=Will you allo
geolocation.shareWithFile3=Will you allow this local file to access your location?
geolocation.remember=Remember this decision
webNotifications.allow=Allow Notifications
webNotifications.allow.accesskey=A
webNotifications.notNow=Not Now
webNotifications.notNow.accesskey=n
webNotifications.never=Never Allow
-webNotifications.neverForSession=Never For This Session
webNotifications.never.accesskey=v
webNotifications.receiveFromSite2=Will you allow %S to send notifications?
# LOCALIZATION NOTE (webNotifications.upgradeTitle): When using native notifications on OS X, the title may be truncated around 32 characters.
webNotifications.upgradeTitle=Upgraded notifications
# LOCALIZATION NOTE (webNotifications.upgradeBody): When using native notifications on OS X, the body may be truncated around 100 characters in some views.
webNotifications.upgradeBody=You can now receive notifications from sites that are not currently loaded. Click to learn more.
# Phishing/Malware Notification Bar.
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -559,37 +559,38 @@ DesktopNotificationPermissionPrompt.prot
try {
hostPort = this.principal.URI.hostPort;
} catch (ex) { }
return gBrowserBundle.formatStringFromName("webNotifications.receiveFromSite2",
[hostPort], 1);
},
get promptActions() {
- return [
+ let actions = [
{
label: gBrowserBundle.GetStringFromName("webNotifications.allow"),
accessKey:
gBrowserBundle.GetStringFromName("webNotifications.allow.accesskey"),
action: SitePermissions.ALLOW,
scope: SitePermissions.SCOPE_PERSISTENT,
},
{
label: gBrowserBundle.GetStringFromName("webNotifications.notNow"),
accessKey:
gBrowserBundle.GetStringFromName("webNotifications.notNow.accesskey"),
action: SitePermissions.BLOCK,
},
- {
- label: PrivateBrowsingUtils.isBrowserPrivate(this.browser) ?
- gBrowserBundle.GetStringFromName("webNotifications.neverForSession") :
- gBrowserBundle.GetStringFromName("webNotifications.never"),
+ ];
+ if (!PrivateBrowsingUtils.isBrowserPrivate(this.browser)) {
+ actions.push({
+ label: gBrowserBundle.GetStringFromName("webNotifications.never"),
accessKey:
gBrowserBundle.GetStringFromName("webNotifications.never.accesskey"),
action: SitePermissions.BLOCK,
scope: SitePermissions.SCOPE_PERSISTENT,
- },
- ];
+ });
+ }
+ return actions;
},
};
PermissionUI.DesktopNotificationPermissionPrompt =
DesktopNotificationPermissionPrompt;