From 6c2dbbebf0bc35bc50e4cceccbe5458f75b25eb6 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 17 Jul 2018 12:58:52 +0200 Subject: [PATCH] Close page action after changes are written to storage. Fixes #209. --- pageAction/pageAction.js | 29 +++++++++++++++++++++-------- releaseNotes.txt | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pageAction/pageAction.js b/pageAction/pageAction.js index 8555c68..2434393 100644 --- a/pageAction/pageAction.js +++ b/pageAction/pageAction.js @@ -40,8 +40,9 @@ name: "disableNotifications", isIcon: true, callback: function(){ - settings.showNotifications = false; - window.close(); + settings.set("showNotifications", false).then(function(){ + window.close(); + }); } } ], @@ -69,9 +70,13 @@ domain ).then(function(domain){ if (domain){ - settings.set("showNotifications", false, domain); + settings.set("showNotifications", false, domain).then(function(){ + window.close(); + }); + } + else { + window.close(); } - window.close(); }); } }, @@ -84,9 +89,13 @@ domain ).then(function(domain){ if (domain){ - settings.set("blockMode", "allow", domain); + settings.set("blockMode", "allow", domain).then(function(){ + window.close(); + }); + } + else { + window.close(); } - window.close(); }); } } @@ -119,9 +128,13 @@ "^" + url.href.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "$" ).then(function(url){ if (url){ - settings.set("blockMode", "allow", url); + settings.set("blockMode", "allow", url).then(function(){ + window.close(); + }); + } + else { + window.close(); } - window.close(); }); } } diff --git a/releaseNotes.txt b/releaseNotes.txt index 2f00e81..8d45b38 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -6,7 +6,7 @@ Version 0.5.1: - fixes: - - + - Changes made in the page action were not saved in all Firefox versions known issues: - if a data URL request is blocked the page action button appears but shows no content