mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 07:07:47 +01:00
Update fix Boston Globe & block scripts while site restrictions
Only enable Boston Globe paywall-script to set cookies at homepage/sections (no text in articles while no cookies). + Option to block scripts while site restrictions.
This commit is contained in:
parent
da627b579d
commit
a82d812c83
1 changed files with 6 additions and 1 deletions
|
@ -303,8 +303,13 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||
|
||||
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
|
||||
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) {
|
||||
// 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 };
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue