Skip to content

Commit a2f6bcb

Browse files
committed
Fix DNRPolicy matching for entries including explicit protocol.
1 parent fb9fa31 commit a2f6bcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bg/DNRPolicy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@
7575
if (Sites.isSecureDomainKey(siteKey)) {
7676
return `||${Sites.toggleSecureDomainKey(siteKey,false)}^`
7777
}
78-
let urlFilter = `||${siteKey}`;
79-
if (!urlFilter.replace(/^[\w-]+:\/+/, "").includes("/")) {
78+
const schemeLess = siteKey.replace(/^[\w-]+:\/+/, "");
79+
let urlFilter = `${siteKey == schemeLess ? "||" : "|"}${siteKey}`;
80+
if (!schemeLess.includes('/')) {
8081
urlFilter += '^';
8182
}
8283
return urlFilter;

0 commit comments

Comments
 (0)