diff options
author | hackademix | 2018-09-26 16:52:06 +0200 |
---|---|---|
committer | hackademix | 2018-09-26 16:52:06 +0200 |
commit | 8b36446fc9c172f0a27cf90b97051091b1a9f472 (patch) | |
tree | a75f2252205373c4c79a1fda2ed8cbdf94ed6689 /src/bg | |
parent | f4055263c7e06dae83942eafe2557c523becfd19 (diff) | |
download | noscript-8b36446fc9c172f0a27cf90b97051091b1a9f472.tar.gz noscript-8b36446fc9c172f0a27cf90b97051091b1a9f472.tar.xz noscript-8b36446fc9c172f0a27cf90b97051091b1a9f472.zip |
Include ftp:// URLs in non-secure domain matching.
Diffstat (limited to 'src/bg')
-rw-r--r-- | src/bg/ChildPolicies.js | 8 |
1 files changed, 6 insertions, 2 deletions
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 = { |