diff --git a/clearurls.js b/clearurls.js index 771a2fb..72a940a 100644 --- a/clearurls.js +++ b/clearurls.js @@ -83,16 +83,16 @@ function Provider(_name,_completeProvider){ var rules = new Array(); var exceptions = new Array(); + if(_completeProvider){ + rules.push(".*"); + } + /** * Add URL pattern. * * @require urlPatterns as RegExp */ this.setURLPattern = function(urlPatterns) { - if(_completeProvider){ - rules.push(urlPatterns); - } - urlPattern = new RegExp(urlPatterns, "mgi"); }; @@ -101,7 +101,7 @@ function Provider(_name,_completeProvider){ * * @return {String} ProviderURL as RegExp */ - this.matchURL = function(url) { + this.matchURL = function(url) { return !(matchException(url)) && (url.match(urlPattern) != null) && (url.match(urlPattern).length > 0); }; @@ -204,7 +204,6 @@ function clearUrl(request) "changes": false, "url": "" }; - // var providers = [amazon, google, googlesyndication, doubleclick, utm]; /* * Call for every provider the removeFieldsFormURL method. diff --git a/data/data.json b/data/data.json index 86debed..da52f5d 100644 --- a/data/data.json +++ b/data/data.json @@ -49,7 +49,7 @@ ] }, "googlesyndication": { - "urlPattern": ".*(\\.googlesyndication\\.)\\w{2,}\\/.*", + "urlPattern": ".*(googlesyndication).*", "completeProvider": true, "rules": [], "exceptions": []