Fixed Sites.domainImplies() misplaced optimization.
This commit is contained in:
parent
21c91ece08
commit
caed2cfa1e
|
@ -29,12 +29,11 @@ var {Permissions, Policy, Sites} = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
static domainImplies(domainKey, site, protocol ="https?") {
|
static domainImplies(domainKey, site, protocol ="https?") {
|
||||||
if (!site.includes(domainKey)) return false;
|
|
||||||
|
|
||||||
if (Sites.isSecureDomainKey(domainKey)) {
|
if (Sites.isSecureDomainKey(domainKey)) {
|
||||||
protocol = "https";
|
protocol = "https";
|
||||||
domainKey = Sites.toggleSecureDomainKey(domainKey, false);
|
domainKey = Sites.toggleSecureDomainKey(domainKey, false);
|
||||||
}
|
}
|
||||||
|
if (!site.includes(domainKey)) return false;
|
||||||
try {
|
try {
|
||||||
return new RegExp(`^${protocol}://([^/?#:]+\\.)?${rxQuote(domainKey)}(?:[:/]|$)`)
|
return new RegExp(`^${protocol}://([^/?#:]+\\.)?${rxQuote(domainKey)}(?:[:/]|$)`)
|
||||||
.test(site);
|
.test(site);
|
||||||
|
|
Loading…
Reference in New Issue