Skip to content

Commit

Permalink
Fix: "*://example.com/*" was suggested for "ftp://example.com/"
Browse files Browse the repository at this point in the history
  • Loading branch information
iorate committed Oct 13, 2018
1 parent 302940c commit 63c1f58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ const saveBlockRules = blockRules => {

const makeMatchPattern = url => {
const u = new URL(url);
return /^(https?|ftp):$/.test(u.protocol) ? '*://' + u.hostname + '/*' : '';
const s = u.protocol.match(/^((https?)|ftp):$/);
return s ? (s[2] ? '*' : s[1]) + '://' + u.hostname + '/*' : '';
};

0 comments on commit 63c1f58

Please sign in to comment.