Add the ability to use wildcard in white/black lists
This commit is contained in:
@@ -17,8 +17,10 @@ function contains(url, list) {
|
|||||||
// If by any chance one line in the list is empty, ignore it
|
// If by any chance one line in the list is empty, ignore it
|
||||||
if(cleanLine === '') continue;
|
if(cleanLine === '') continue;
|
||||||
|
|
||||||
// If url contains the current line return true
|
var lineRe = new RegExp(cleanLine.replace('.', '\.').replace('*', '.*'));
|
||||||
if (url.indexOf(cleanLine) > -1) {
|
|
||||||
|
// If url matches the current line return true
|
||||||
|
if (lineRe.test(url)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user