Bug 1348735 - Add a separate accesskey for "Never For This Session" in web notification permission prompts. r=johannh
MozReview-Commit-ID: BW9auLhZ4i9
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -492,18 +492,19 @@ 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.never.accesskey=v
webNotifications.neverForSession=Never For This Session
-webNotifications.never.accesskey=v
+webNotifications.neverForSession.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.
# LOCALIZATION NOTE (notADeceptiveSite, notAnAttack)
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -559,35 +559,37 @@ DesktopNotificationPermissionPrompt.prot
try {
hostPort = this.principal.URI.hostPort;
} catch (ex) { }
return gBrowserBundle.formatStringFromName("webNotifications.receiveFromSite2",
[hostPort], 1);
},
get promptActions() {
+ let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
return [
{
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) ?
+ label: isBrowserPrivate ?
gBrowserBundle.GetStringFromName("webNotifications.neverForSession") :
gBrowserBundle.GetStringFromName("webNotifications.never"),
- accessKey:
+ accessKey: isBrowserPrivate ?
+ gBrowserBundle.GetStringFromName("webNotifications.neverForSession.accesskey") :
gBrowserBundle.GetStringFromName("webNotifications.never.accesskey"),
action: SitePermissions.BLOCK,
scope: SitePermissions.SCOPE_PERSISTENT,
},
];
},
};