|
|
|
@ -13,8 +13,7 @@ const restrictions = {
|
|
|
|
|
'elcomercio.pe': /.+\/elcomercio.pe\/.+((\w)+(\-)+){3,}.+/,
|
|
|
|
|
'gestion.pe': /.+\/gestion.pe\/.+((\w)+(\-)+){3,}.+/,
|
|
|
|
|
'quora.com': /^((?!quora\.com\/search\?q=).)*$/,
|
|
|
|
|
'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/,
|
|
|
|
|
'theglobeandmail.com': /(.+theglobeandmail\.com\/.+\/article-.+|.+theglobeandmail\.com\/pb\/resources\/scripts\/build\/.+\.js)/
|
|
|
|
|
'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Don't remove cookies before page load
|
|
|
|
@ -198,7 +197,6 @@ var blockedRegexes = {
|
|
|
|
|
'theadvocate.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/,
|
|
|
|
|
'thecourier.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/,
|
|
|
|
|
'thedailybeast.com': /.+\.tinypass\.com\/.+/,
|
|
|
|
|
'theglobeandmail.com': /theglobeandmail\.com\/pb\/resources\/scripts\/build\/chunk-common-vendor.+\.js/,
|
|
|
|
|
'thenation.com': /.+\.tinypass\.com\/.+/,
|
|
|
|
|
'valeursactuelles.com': /.+\.poool\.fr\/.+/
|
|
|
|
|
};
|
|
|
|
@ -394,12 +392,8 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|
|
|
|
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
|
|
|
|
|
var blockedDomains = Object.keys(blockedRegexes);
|
|
|
|
|
var domain = matchUrlDomain(blockedDomains, header_referer);
|
|
|
|
|
var block_regex = true;
|
|
|
|
|
if (domain && details.url.match(blockedRegexes[domain]) && isSiteEnabled({url: header_referer})) {
|
|
|
|
|
if (domain === 'theglobeandmail.com' && !(header_referer.includes('?ref=premium'))) {
|
|
|
|
|
block_regex = false;
|
|
|
|
|
}
|
|
|
|
|
if (block_regex) return { cancel: true };
|
|
|
|
|
return { cancel: true };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isSiteEnabled(details)) {
|
|
|
|
|