Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 const whitelist = { | |
2 check: function(url) { | |
3 rules = lists.whitelist.get(); | |
4 for(i in rules) { | |
5 if(url.match(this.regex(rules[i]))) | |
6 return false; | |
7 } | |
8 return true; | |
9 }, | |
10 regex: function(rule) { | |
11 return RegExp(rule.replace(".","\\.").replace("*",".*").replace( "[","\\[").replace("(","\\(").replace("||","[a-z]+://([a-z]+\\.){0,2}").replace( "^","[!\"#$&'()*+,/:;<=>?@[\\]\\\\^`{}|~]")); | |
12 } | |
13 }; | |
OLD | NEW |