diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 44d4e82..f288bc4 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -159,7 +159,7 @@ "message": "General" }, "NotEnforced": { - "message": "Restrictions disabled" + "message": "Restrictions disabled by user's settings: NoScript won't block anything on this page!" }, "NoEnforcement": { "message": "Disable restrictions globally (dangerous)" diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index 12e6be8..3f95f97 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -212,7 +212,7 @@ "description": "" }, "NotEnforced": { - "message": "Restrizioni disattivate", + "message": "Restrizioni disattivate per scelta dell'utente: NoScript non bloccherà nulla in questa pagina!", "description": "" }, "NoEnforcement": { diff --git a/src/ui/popup.js b/src/ui/popup.js index 77f22d5..3a88658 100644 --- a/src/ui/popup.js +++ b/src/ui/popup.js @@ -177,6 +177,14 @@ addEventListener("unload", e => { }, true); } + let enforcementWarning = button => { + if (button) { + let clone = button.cloneNode(true); + clone.onclick = button.onclick; + button = clone; + } + messageBox(button ? "warning" : "hidden", _("NotEnforced"), button); + }; let setupEnforcement = () => { let policy = UI.policy; let pressed = policy.enforced; @@ -191,6 +199,7 @@ addEventListener("unload", e => { pendingReload(true); }; button.disabled = false; + enforcementWarning(!policy.enforced && button); setupTabEnforcement(); }; @@ -200,7 +209,6 @@ addEventListener("unload", e => { button.setAttribute("aria-pressed", pressed); button.title = _(pressed ? "NoEnforcementForTab" : "EnforceForTab"); if (UI.policy.enforced) { - button.disabled = false; button.onclick = async () => { this.disabled = true; await UI.updateSettings({ @@ -211,6 +219,8 @@ addEventListener("unload", e => { setupEnforcement(); pendingReload(true); } + button.disabled = false; + enforcementWarning(UI.unrestrictedTab && button); } else { button.disabled = true; }