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. 8, 2012, 5:58 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « files/translators.js ('k') | help.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « files/translators.js ('k') | help.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld