diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index 563139c0ebd3..133a6c9d55f8 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -639,13 +639,21 @@ persistentStorage.block.accesskey=B persistentStorage.allowWithSite2=Allow %S to store data in persistent storage? persistentStorage.remember=Remember this decision -webNotifications.allow=Allow Notifications -webNotifications.allow.accesskey=A +# Web notifications UI +# LOCALIZATION NOTE (alwaysBlock, block) +# The two button strings will never be shown at the same time, so +# it's okay for them to have the same access key +webNotifications.allow2=Allow +webNotifications.allow2.accesskey=A webNotifications.notNow=Not Now webNotifications.notNow.accesskey=n webNotifications.never=Never Allow webNotifications.never.accesskey=v -webNotifications.receiveFromSite2=Will you allow %S to send notifications? +webNotifications.alwaysBlock=Always Block +webNotifications.alwaysBlock.accesskey=B +webNotifications.block=Block +webNotifications.block.accesskey=B +webNotifications.receiveFromSite3=Allow %S to send notifications? # Phishing/Malware Notification Bar. # LOCALIZATION NOTE (notADeceptiveSite, notAnAttack) diff --git a/browser/modules/PermissionUI.jsm b/browser/modules/PermissionUI.jsm index d3c097af20cd..1a22782ec097 100644 --- a/browser/modules/PermissionUI.jsm +++ b/browser/modules/PermissionUI.jsm @@ -1000,7 +1000,7 @@ DesktopNotificationPermissionPrompt.prototype = { get message() { return gBrowserBundle.formatStringFromName( - "webNotifications.receiveFromSite2", + "webNotifications.receiveFromSite3", ["<>"] ); }, @@ -1008,9 +1008,9 @@ DesktopNotificationPermissionPrompt.prototype = { get promptActions() { let actions = [ { - label: gBrowserBundle.GetStringFromName("webNotifications.allow"), + label: gBrowserBundle.GetStringFromName("webNotifications.allow2"), accessKey: gBrowserBundle.GetStringFromName( - "webNotifications.allow.accesskey" + "webNotifications.allow2.accesskey" ), action: SitePermissions.ALLOW, scope: SitePermissions.SCOPE_PERSISTENT, @@ -1025,13 +1025,19 @@ DesktopNotificationPermissionPrompt.prototype = { action: SitePermissions.BLOCK, }); } + + let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser); actions.push({ - label: gBrowserBundle.GetStringFromName("webNotifications.never"), - accessKey: gBrowserBundle.GetStringFromName( - "webNotifications.never.accesskey" - ), + label: isBrowserPrivate + ? gBrowserBundle.GetStringFromName("webNotifications.block") + : gBrowserBundle.GetStringFromName("webNotifications.alwaysBlock"), + accessKey: isBrowserPrivate + ? gBrowserBundle.GetStringFromName("webNotifications.block.accesskey") + : gBrowserBundle.GetStringFromName( + "webNotifications.alwaysBlock.accesskey" + ), action: SitePermissions.BLOCK, - scope: PrivateBrowsingUtils.isBrowserPrivate(this.browser) + scope: isBrowserPrivate ? SitePermissions.SCOPE_SESSION : SitePermissions.SCOPE_PERSISTENT, }); @@ -1039,22 +1045,29 @@ DesktopNotificationPermissionPrompt.prototype = { }, get postPromptActions() { - return [ + let actions = [ { - label: gBrowserBundle.GetStringFromName("webNotifications.allow"), + label: gBrowserBundle.GetStringFromName("webNotifications.allow2"), accessKey: gBrowserBundle.GetStringFromName( - "webNotifications.allow.accesskey" + "webNotifications.allow2.accesskey" ), action: SitePermissions.ALLOW, }, - { - label: gBrowserBundle.GetStringFromName("webNotifications.never"), - accessKey: gBrowserBundle.GetStringFromName( - "webNotifications.never.accesskey" - ), - action: SitePermissions.BLOCK, - }, ]; + + let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser); + actions.push({ + label: isBrowserPrivate + ? gBrowserBundle.GetStringFromName("webNotifications.block") + : gBrowserBundle.GetStringFromName("webNotifications.alwaysBlock"), + accessKey: isBrowserPrivate + ? gBrowserBundle.GetStringFromName("webNotifications.block.accesskey") + : gBrowserBundle.GetStringFromName( + "webNotifications.alwaysBlock.accesskey" + ), + action: SitePermissions.BLOCK, + }); + return actions; }, };