From 09a659301194e818f4a11c9270104bcff7ab80c4 Mon Sep 17 00:00:00 2001 From: hackademix Date: Wed, 13 Jan 2021 23:50:55 +0100 Subject: [PATCH] More lenient filter to add a new entry to per-site permissions. --- src/ui/options.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/options.js b/src/ui/options.js index fddd582..0eafab7 100644 --- a/src/ui/options.js +++ b/src/ui/options.js @@ -163,7 +163,10 @@ let newSiteForm = document.querySelector("#form-newsite"); let newSiteInput = newSiteForm.newsite; let button = newSiteForm.querySelector("button"); - let canAdd = s => policy.get(s).siteMatch === null; + let canAdd = s => { + let match = policy.get(s).siteMatch; + return match === null || s.length > match.length; + } let validate = () => { let site = newSiteInput.value.trim();