diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 06:17:52 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-26 06:17:52 +0200 |
commit | 43caa48ecba88a60b7b0b84d19d928ada8b22b09 (patch) | |
tree | 11eeb7813247332ae621140dab41e6f1ea033b08 /application/palemoon/components/preferences | |
parent | c86fbfd0313ae6bd6c54ea8f4a28b42f7852b38c (diff) | |
download | UXP-43caa48ecba88a60b7b0b84d19d928ada8b22b09.tar UXP-43caa48ecba88a60b7b0b84d19d928ada8b22b09.tar.gz UXP-43caa48ecba88a60b7b0b84d19d928ada8b22b09.tar.lz UXP-43caa48ecba88a60b7b0b84d19d928ada8b22b09.tar.xz UXP-43caa48ecba88a60b7b0b84d19d928ada8b22b09.zip |
Bug 1038811 - Push Notifications - Firefox front end changes for preferences, and permission notification
Diffstat (limited to 'application/palemoon/components/preferences')
-rw-r--r-- | application/palemoon/components/preferences/aboutPermissions.js | 19 | ||||
-rw-r--r-- | application/palemoon/components/preferences/aboutPermissions.xul | 20 |
2 files changed, 37 insertions, 2 deletions
diff --git a/application/palemoon/components/preferences/aboutPermissions.js b/application/palemoon/components/preferences/aboutPermissions.js index 416bcdf34..0c3f8b823 100644 --- a/application/palemoon/components/preferences/aboutPermissions.js +++ b/application/palemoon/components/preferences/aboutPermissions.js @@ -449,6 +449,19 @@ var PermissionDefaults = { let value = (aValue != this.DENY); Services.prefs.setBoolPref("full-screen-api.pointer-lock.enabled", value); }, + + get push() { + if (!Services.prefs.getBoolPref("dom.push.enabled")) { + return this.DENY; + } + // We always ask for permission to push with a specific site, + // so there is no global ALLOW. + return this.UNKNOWN; + }, + set push(aValue) { + let value = (aValue != this.DENY); + Services.prefs.setBoolPref("dom.push.enabled", value); + }, } /** @@ -488,13 +501,13 @@ var AboutPermissions = { */ _supportedPermissions: ["password", "image", "popup", "cookie", "desktop-notification", "install", "geo", "indexedDB", - "fullscreen", "pointerLock"], + "fullscreen", "pointerLock", "push"], /** * Permissions that don't have a global "Allow" option. */ _noGlobalAllow: ["desktop-notification", "geo", "indexedDB", "fullscreen", - "pointerLock"], + "pointerLock", "push"], /** * Permissions that don't have a global "Deny" option. @@ -543,6 +556,7 @@ var AboutPermissions = { Services.prefs.addObserver("plugins.click_to_play", this, false); Services.prefs.addObserver("full-screen-api.enabled", this, false); Services.prefs.addObserver("full-screen-api.pointer-lock.enabled", this, false); + Services.prefs.addObserver("dom.push.enabled", this, false); Services.prefs.addObserver("permissions.places-sites-limit", this, false); Services.obs.addObserver(this, "perm-changed", false); @@ -695,6 +709,7 @@ var AboutPermissions = { Services.prefs.removeObserver("plugins.click_to_play", this, false); Services.prefs.removeObserver("full-screen-api.enabled", this, false); Services.prefs.removeObserver("full-screen-api.pointer-lock.enabled", this, false); + Services.prefs.removeObserver("dom.push.enabled", this, false); Services.prefs.removeObserver("permissions.places-sites-limit", this, false); Services.obs.removeObserver(this, "perm-changed"); diff --git a/application/palemoon/components/preferences/aboutPermissions.xul b/application/palemoon/components/preferences/aboutPermissions.xul index bd5a205c7..279de8d9b 100644 --- a/application/palemoon/components/preferences/aboutPermissions.xul +++ b/application/palemoon/components/preferences/aboutPermissions.xul @@ -391,6 +391,26 @@ </vbox> </hbox> + <!-- Push Notifications --> + <hbox id="push-pref-item" + class="pref-item" align="top"> + <image class="pref-icon" type="push"/> + <vbox> + <label class="pref-title" value="&push.label;"/> + <hbox align="center"> + <menulist id="push-menulist" + class="pref-menulist" + type="push" + oncommand="AboutPermissions.onPermissionCommand(event);"> + <menupopup> + <menuitem id="push-0" value="0" label="&permission.alwaysAsk;"/> + <menuitem id="push-1" value="1" label="&permission.allow;"/> + <menuitem id="push-2" value="2" label="&permission.block;"/> + </menupopup> + </menulist> + </hbox> + </vbox> + </hbox> </vbox> </hbox> |