summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/nsBrowserGlue.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-26 10:11:19 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-26 10:11:19 +0200
commit7b7c12e0a36bb6fc8398baec12c0c5e484b38f5a (patch)
tree3b8ab1c326d8b9c3a65df233d038216fa059bdba /application/palemoon/components/nsBrowserGlue.js
parentd49d212c38592c68c3e217dcf8bbe6f3ee54ecbf (diff)
downloadUXP-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/palemoon/components/nsBrowserGlue.js')
-rw-r--r--application/palemoon/components/nsBrowserGlue.js55
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"),
};