From e4257a953dd3984f9aba7088e608763a95f156a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Fri, 4 Aug 2017 03:21:44 +0200 Subject: [PATCH] test --- clearurls.js | 5 ++++- data/data.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clearurls.js b/clearurls.js index 25cf921..95913cd 100644 --- a/clearurls.js +++ b/clearurls.js @@ -13,7 +13,7 @@ function fetchFromURL(url) } } -var data = fetchFromURL('https://raw.githubusercontent.com/KevinRoebert/ClearUrls/master/data/data.json'); +var data = fetchFromURL('https://raw.githubusercontent.com/KevinRoebert/ClearUrls/master/data/data.json') || []; var providers = []; // ################################################################## @@ -200,6 +200,9 @@ function createProviders() //Create new provider providers.push(new Provider(data.providers[p],data.providers[p].completeProvider)); + //Add URL Pattern + providers[p].setURLPattern(data.providers[p].urlPattern); + //Add rules to provider for(var r = 0; r < data.providers[p].rules.length; r++) { diff --git a/data/data.json b/data/data.json index 5a0a098..9f70f6c 100644 --- a/data/data.json +++ b/data/data.json @@ -1,7 +1,7 @@ { "providers": { "amazon": { - "urlPattern": "", + "urlPattern": "(https:\\/\\/||http:\\/\\/).*(\\.amazon\\.)\\w{2,}\\/.*", "completeProvider": true, "rules": [ "pf_rd_[a-zA-Z]=[a-zA-Z0-9\\-\\.\\_]*[\\?|&]?",