summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhackademix2018-08-24 02:58:46 +0200
committerhackademix2018-08-24 02:58:46 +0200
commitcaed2cfa1e93ef72b1fb23adf11f2acdb37a805a (patch)
tree1691128eb586f37362a2d933fc64378c2b4abc99 /src
parent21c91ece08293c20868d575204065462c09b57a9 (diff)
downloadnoscript-caed2cfa1e93ef72b1fb23adf11f2acdb37a805a.tar.gz
noscript-caed2cfa1e93ef72b1fb23adf11f2acdb37a805a.tar.xz
noscript-caed2cfa1e93ef72b1fb23adf11f2acdb37a805a.zip
Fixed Sites.domainImplies() misplaced optimization.
Diffstat (limited to 'src')
-rw-r--r--src/common/Policy.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common/Policy.js b/src/common/Policy.js
index 3c31c71..9afc92e 100644
--- a/src/common/Policy.js
+++ b/src/common/Policy.js
@@ -29,12 +29,11 @@ var {Permissions, Policy, Sites} = (() => {
}
static domainImplies(domainKey, site, protocol ="https?") {
- if (!site.includes(domainKey)) return false;
-
if (Sites.isSecureDomainKey(domainKey)) {
protocol = "https";
domainKey = Sites.toggleSecureDomainKey(domainKey, false);
}
+ if (!site.includes(domainKey)) return false;
try {
return new RegExp(`^${protocol}://([^/?#:]+\\.)?${rxQuote(domainKey)}(?:[:/]|$)`)
.test(site);