From 0d7afa78f0125aa606d5f47cd9518514770dd474 Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Oct 2018 21:40:07 +0300 Subject: [PALEMOON] Add filter query to about:permissions --- application/palemoon/components/permissions/aboutPermissions.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'application') diff --git a/application/palemoon/components/permissions/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js index 6a02daa29..421b65a0e 100644 --- a/application/palemoon/components/permissions/aboutPermissions.js +++ b/application/palemoon/components/permissions/aboutPermissions.js @@ -516,6 +516,14 @@ var AboutPermissions = { Services.obs.notifyObservers(null, "browser-permissions-preinit", null); this._initPart2(); + + // Process about:permissions?filter= + // About URIs don't support query params, so do this manually + var loc = document.location.href; + var matches = /[?&]filter\=([^&]+)/i.exec(loc); + if (matches) { + this.sitesFilter.value = decodeURIComponent(matches[1]); + } }, sitesReload: function() { -- cgit v1.2.3 From 4c488cb7f10ad18c0759903c7bef67ad432f96bc Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Oct 2018 21:41:07 +0300 Subject: [PALEMOON] Open about:permissions when notification settings are requested --- application/palemoon/components/nsBrowserGlue.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'application') diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 720d1165c..f0a7aa22a 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -152,6 +152,9 @@ BrowserGlue.prototype = { // nsIObserver implementation observe: function BG_observe(subject, topic, data) { switch (topic) { + case "notifications-open-settings": + this._openPermissions(subject); + break; case "prefservice:after-app-defaults": this._onAppDefaults(); break; @@ -322,6 +325,7 @@ BrowserGlue.prototype = { // initialization (called on application startup) _init: function BG__init() { let os = Services.obs; + os.addObserver(this, "notifications-open-settings", false); os.addObserver(this, "prefservice:after-app-defaults", false); os.addObserver(this, "final-ui-startup", false); os.addObserver(this, "browser-delayed-startup-finished", false); @@ -354,6 +358,7 @@ BrowserGlue.prototype = { // cleanup (called on application shutdown) _dispose: function BG__dispose() { let os = Services.obs; + os.removeObserver(this, "notifications-open-settings"); os.removeObserver(this, "prefservice:after-app-defaults"); os.removeObserver(this, "final-ui-startup"); 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() { try { return !!Cc["@mozilla.org/system-alerts-service;1"].getService( -- cgit v1.2.3