From 103324e5d2ea5ac2ea589a44b822a997ff503be3 Mon Sep 17 00:00:00 2001 From: hackademix Date: Mon, 9 Jul 2018 01:36:28 +0200 Subject: More graceful handling of internal and restricted URLs. --- src/ui/popup.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ui/popup.js') diff --git a/src/ui/popup.js b/src/ui/popup.js index 8ca4f44..059e3df 100644 --- a/src/ui/popup.js +++ b/src/ui/popup.js @@ -130,10 +130,14 @@ addEventListener("unload", e => { } catch (e) { error(e, "Could not run scripts on %s: privileged page?", tab.url); } - if (!isHttp) { + + await include("/lib/restricted.js"); + let isRestricted = isRestrictedURL(tab.url); + if (!isHttp || isRestricted) { showMessage("warning", _("privilegedPage")); let tempTrust = document.getElementById("temp-trust-page"); tempTrust.disabled = true; + return; } if (!UI.seen) { if (!isHttp) return; -- cgit v1.2.3