mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
[PALEMOON] Open about:permissions when notification settings are requested
This commit is contained in:
parent
480876a862
commit
c672f9fc86
1 changed files with 15 additions and 0 deletions
|
|
@ -152,6 +152,9 @@ BrowserGlue.prototype = {
|
||||||
// nsIObserver implementation
|
// nsIObserver implementation
|
||||||
observe: function BG_observe(subject, topic, data) {
|
observe: function BG_observe(subject, topic, data) {
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
|
case "notifications-open-settings":
|
||||||
|
this._openPermissions(subject);
|
||||||
|
break;
|
||||||
case "prefservice:after-app-defaults":
|
case "prefservice:after-app-defaults":
|
||||||
this._onAppDefaults();
|
this._onAppDefaults();
|
||||||
break;
|
break;
|
||||||
|
|
@ -322,6 +325,7 @@ BrowserGlue.prototype = {
|
||||||
// initialization (called on application startup)
|
// initialization (called on application startup)
|
||||||
_init: function BG__init() {
|
_init: function BG__init() {
|
||||||
let os = Services.obs;
|
let os = Services.obs;
|
||||||
|
os.addObserver(this, "notifications-open-settings", false);
|
||||||
os.addObserver(this, "prefservice:after-app-defaults", false);
|
os.addObserver(this, "prefservice:after-app-defaults", false);
|
||||||
os.addObserver(this, "final-ui-startup", false);
|
os.addObserver(this, "final-ui-startup", false);
|
||||||
os.addObserver(this, "browser-delayed-startup-finished", false);
|
os.addObserver(this, "browser-delayed-startup-finished", false);
|
||||||
|
|
@ -354,6 +358,7 @@ BrowserGlue.prototype = {
|
||||||
// cleanup (called on application shutdown)
|
// cleanup (called on application shutdown)
|
||||||
_dispose: function BG__dispose() {
|
_dispose: function BG__dispose() {
|
||||||
let os = Services.obs;
|
let os = Services.obs;
|
||||||
|
os.removeObserver(this, "notifications-open-settings");
|
||||||
os.removeObserver(this, "prefservice:after-app-defaults");
|
os.removeObserver(this, "prefservice:after-app-defaults");
|
||||||
os.removeObserver(this, "final-ui-startup");
|
os.removeObserver(this, "final-ui-startup");
|
||||||
os.removeObserver(this, "sessionstore-windows-restored");
|
os.removeObserver(this, "sessionstore-windows-restored");
|
||||||
|
|
@ -1484,6 +1489,16 @@ BrowserGlue.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_openPermissions: function(aPrincipal) {
|
||||||
|
var win = this.getMostRecentBrowserWindow();
|
||||||
|
var url = "about:permissions";
|
||||||
|
try {
|
||||||
|
url = url + "?filter=" + aPrincipal.URI.host;
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
|
win.openUILinkIn(url, "tab");
|
||||||
|
},
|
||||||
|
|
||||||
_hasSystemAlertsService: function() {
|
_hasSystemAlertsService: function() {
|
||||||
try {
|
try {
|
||||||
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue