Fixes naked domains with no HTTPS lock and explicit port numbers not correctly matched in mapped MV3 DNR rules (issue #387).
This commit is contained in:
parent
317b97ccce
commit
cbc3c239f2
|
@ -70,9 +70,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function toUrlFilter(siteKey) {
|
function toUrlFilter(siteKey) {
|
||||||
let urlFilter = `|${siteKey.replace(/^§:/, '|')}`;
|
// Note: using '^' instead of '/' as a terminator
|
||||||
if (!urlFilter.replace(/^\w+:\/+/).includes("/")) {
|
// takes explicit port numbers in account
|
||||||
urlFilter += "/";
|
if (Sites.isSecureDomainKey(siteKey)) {
|
||||||
|
return `||${Sites.toggleSecureDomainKey(siteKey,false)}^`
|
||||||
|
}
|
||||||
|
let urlFilter = `||${siteKey}`;
|
||||||
|
if (!urlFilter.replace(/^[\w-]+:\/+/, "").includes("/")) {
|
||||||
|
urlFilter += '^';
|
||||||
}
|
}
|
||||||
return urlFilter;
|
return urlFilter;
|
||||||
}
|
}
|
||||||
|
@ -93,8 +98,8 @@
|
||||||
if (!policy || policy.equals(_lastPolicy)) {
|
if (!policy || policy.equals(_lastPolicy)) {
|
||||||
return await updateTabs();
|
return await updateTabs();
|
||||||
}
|
}
|
||||||
_lastPolicy = policy;
|
|
||||||
}
|
}
|
||||||
|
_lastPolicy = policy;
|
||||||
|
|
||||||
const Rules = {
|
const Rules = {
|
||||||
// Using capitalized keys to allow DRY tricks with get/update methods
|
// Using capitalized keys to allow DRY tricks with get/update methods
|
||||||
|
|
Loading…
Reference in New Issue