Update fix Boston Globe & option to block scripts while site restrictions
Only enable Boston Globe paywall-script to set cookies at homepage/sections (no text in articles while no cookies).
This commit is contained in:
parent
646c08f1d4
commit
cef95bc772
@ -349,8 +349,13 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||||||
|
|
||||||
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
|
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
|
||||||
for (var domain in blockedRegexes) {
|
for (var domain in blockedRegexes) {
|
||||||
if (isSiteEnabled({url: '.'+ domain}) && details.url.match(blockedRegexes[domain])) {
|
if ((isSiteEnabled({url: '.'+ domain}) || isSiteEnabled({url: header_referer})) && details.url.match(blockedRegexes[domain])) {
|
||||||
if (details.url.indexOf(domain) !== -1 || header_referer.indexOf(domain) !== -1) {
|
if (details.url.indexOf(domain) !== -1 || header_referer.indexOf(domain) !== -1) {
|
||||||
|
// allow BG paywall-script to set cookies in homepage/sections (else no article-text)
|
||||||
|
if (details.url.indexOf('meter.bostonglobe.com/js/') !== -1 && (header_referer === 'https://www.bostonglobe.com/'
|
||||||
|
|| header_referer.indexOf('/?p1=BGHeader_') !== -1 || header_referer.indexOf('/?p1=BGMenu_') !== -1)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
return { cancel: true };
|
return { cancel: true };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user