From 8b36446fc9c172f0a27cf90b97051091b1a9f472 Mon Sep 17 00:00:00 2001 From: hackademix Date: Wed, 26 Sep 2018 16:52:06 +0200 Subject: Include ftp:// URLs in non-secure domain matching. --- src/bg/ChildPolicies.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bg/ChildPolicies.js b/src/bg/ChildPolicies.js index 67c0c81..f3845bd 100644 --- a/src/bg/ChildPolicies.js +++ b/src/bg/ChildPolicies.js @@ -92,11 +92,15 @@ patterns.map(p => p.replace(rx, (m, host) => tld.isIp(host) ? m : m + ".") ).filter(validMatchPattern) ); - } + }; + + let extraProtocols = patterns => patterns.concat( + patterns.filter(p => p.startsWith("*://")) + .map(p => p.replace("*", "ftp"))); let siteKeys2MatchPatterns = keys => keys ? [... new Set( - withFQDNs(flatten(keys.map(siteKey2MatchPattern)).filter(p => !!p)))] + extraProtocols(withFQDNs(flatten(keys.map(siteKey2MatchPattern)).filter(p => !!p))))] : []; var ChildPolicies = { -- cgit v1.2.3