summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackademix2018-08-28 23:40:20 +0200
committerhackademix2018-08-28 23:40:20 +0200
commit22df979973f6e64f952275bb9815e64920048a19 (patch)
tree88335fbc6d2cc4aa2f9fe2aa90c366f6c6aa680a
parent5c3d5354f2aa3d9cc4ab7fcdf15c3350122851cb (diff)
downloadnoscript-22df979973f6e64f952275bb9815e64920048a19.tar.gz
noscript-22df979973f6e64f952275bb9815e64920048a19.tar.xz
noscript-22df979973f6e64f952275bb9815e64920048a19.zip
Better timing feedback for permissions changes in the popup UI.
-rw-r--r--src/ui/popup.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/popup.js b/src/ui/popup.js
index bc054d1..a068ffb 100644
--- a/src/ui/popup.js
+++ b/src/ui/popup.js
@@ -77,9 +77,10 @@ addEventListener("unload", e => {
let button = document.getElementById("enforce");
button.setAttribute("aria-pressed", pressed);
button.textContent = button.title = _(pressed ? "NoEnforcement" : "Enforce");
- button.onclick = () => {
+ button.onclick = async () => {
+ this.disabled = true;
policy.enforced = !pressed;
- UI.updateSettings({policy, reloadAffected: true});
+ await UI.updateSettings({policy, reloadAffected: true});
close();
}
}
@@ -89,8 +90,9 @@ addEventListener("unload", e => {
button.setAttribute("aria-pressed", pressed);
button.textContent = button.title = _(pressed ? "NoEnforcementForTab" : "EnforceForTab");
if (UI.policy.enforced) {
- button.onclick = () => {
- UI.updateSettings({
+ button.onclick = async () => {
+ this.disabled = true;
+ await UI.updateSettings({
unrestrictedTab: pressed,
reloadAffected: true,
});
@@ -129,7 +131,7 @@ addEventListener("unload", e => {
error(e, "Could not run scripts on %s: privileged page?", tab.url);
}
- await include("/lib/restricted.js");
+ await include("/lib/close\(ricted.js");
let isRestricted = isRestrictedURL(tab.url);
if (!isHttp || isRestricted) {
showMessage("warning", _("privilegedPage"));