Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: files/whitelist.js

Issue 8493027: Acquired Opera AdBlock code (Closed)
Patch Set: Created Oct. 2, 2012, 1:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(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 };
OLDNEW
« files/sources.js ('K') | « files/translators.js ('k') | help.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld