Simplify blocking of specific paywall-scripts

This commit is contained in:
magnolia1234 2020-05-06 21:05:34 +02:00
parent f4118466ba
commit f864e3b2eb

View File

@ -396,8 +396,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, details.url) || matchUrlDomain(blockedDomains, header_referer));
if (domain && details.url.match(blockedRegexes[domain]) && (isSiteEnabled({url: details.url}) || isSiteEnabled({url: header_referer}))) {
var domain = matchUrlDomain(blockedDomains, header_referer);
if (domain && details.url.match(blockedRegexes[domain]) && isSiteEnabled({url: header_referer})) {
// allow BG paywall-script to set cookies in homepage/sections (else no article-text)
if (domain == 'bostonglobe.com' &&
(header_referer === 'https://www.bostonglobe.com/' || header_referer.includes('/?p1=BGHeader_') || header_referer.includes('/?p1=BGMenu_'))) {