From 9884643742b54b88f94111d62f5e89a12a60e604 Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 26 Mar 2019 22:45:37 +0100 Subject: Subdomain wildcard support. --- html/preferences_panel/pref.js | 3 +++ html/preferences_panel/preferences_panel.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'html/preferences_panel') diff --git a/html/preferences_panel/pref.js b/html/preferences_panel/pref.js index 9cecbb6..debb468 100644 --- a/html/preferences_panel/pref.js +++ b/html/preferences_panel/pref.js @@ -40,6 +40,9 @@ error = "Only one single trailing path wildcard (/*) allowed"; } } catch (e) { + if (/^https?:\/\/\*\./.test(url)) { + return this.malformedUrl(url.replace("*.", "")); + } error = "Invalid URL"; if (url && !url.includes("://")) error += ": missing protocol, either http:// or https://"; else if (url.endsWith("://")) error += ": missing domain name"; diff --git a/html/preferences_panel/preferences_panel.html b/html/preferences_panel/preferences_panel.html index 3a0ad7a..081ae07 100644 --- a/html/preferences_panel/preferences_panel.html +++ b/html/preferences_panel/preferences_panel.html @@ -45,10 +45,10 @@

Settings

-
Allow or block scripts matching the following URLs ("*" matches any path) +
Allow or block scripts matching the following URLs ("*."" matches any subdomain, "/*" matches any path)
- +
-- cgit v1.2.3