diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 10:11:19 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 10:11:19 +0200 |
commit | 7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a (patch) | |
tree | 3b8ab1c326d8b9c3a65df233d038216fa059bdba /application | |
parent | d49d212c38592c68c3e217dcf8bbe6f3ee54ecbf (diff) | |
download | UXP-7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a.tar UXP-7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a.tar.gz UXP-7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a.tar.lz UXP-7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a.tar.xz UXP-7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a.zip |
Bug 1216684 - Notification permissions cannot be global granted/denied in private windows
Diffstat (limited to 'application')
-rw-r--r-- | application/palemoon/components/nsBrowserGlue.js | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 642e27c6b..9c3a9fbee 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1809,27 +1809,42 @@ ContentPermissionPrompt.prototype = { var message = browserBundle.formatStringFromName("webNotifications.showFromSite", [requestingURI.host], 1); - var actions = [ - { - stringId: "webNotifications.showForSession", - action: Ci.nsIPermissionManager.ALLOW_ACTION, - expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, - callback: function() {}, - }, - { - stringId: "webNotifications.alwaysShow", - action: Ci.nsIPermissionManager.ALLOW_ACTION, - expireType: null, - callback: function() {}, - }, - { - stringId: "webNotifications.neverShow", - action: Ci.nsIPermissionManager.DENY_ACTION, - expireType: null, - callback: function() {}, - }, - ]; + var actions; + var browser = this._getBrowserForRequest(aRequest); + // Only show "allow for session" in PB mode, we don't + // support "allow for session" in non-PB mode. + if (PrivateBrowsingUtils.isBrowserPrivate(browser)) { + actions = [ + { + stringId: "webNotifications.showForSession", + action: Ci.nsIPermissionManager.ALLOW_ACTION, + expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, + callback: function() {}, + }, + ]; + } else { + actions = [ + { + stringId: "webNotifications.showForSession", + action: Ci.nsIPermissionManager.ALLOW_ACTION, + expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, + callback: function() {}, + }, + { + stringId: "webNotifications.alwaysShow", + action: Ci.nsIPermissionManager.ALLOW_ACTION, + expireType: null, + callback: function() {}, + }, + { + stringId: "webNotifications.neverShow", + action: Ci.nsIPermissionManager.DENY_ACTION, + expireType: null, + callback: function() {}, + }, + ]; + } var options = { learnMoreURL: Services.urlFormatter.formatURLPref("browser.push.warning.infoURL"), }; |