Add regional Ad.nl sites (ADR)

Add ADR sites like BN DeStem, Brabants Dagblad, Eindhovens Dagblad, Gelderlander, PZC, Stentor, Tubantia.
Only option for Ad.nl is needed.
This commit is contained in:
magnolia1234 2020-01-19 17:44:54 +01:00 committed by GitHub
parent bf261345ac
commit 4006c2e5b4
3 changed files with 24 additions and 6 deletions

View File

@ -151,15 +151,20 @@ Visit the [Firefox repository](https://github.com/magnolia1234/bypass-paywalls-f
[La Repubblica](https://www.repubblica.it) -
[La Stampa](https://www.lastampa.it)
##### Netherlands/Flanders
[Algemeen Dagblad](https://www.ad.nl) -
[Eindhovens Dagblad](https://ed.nl) -
[Algemeen Dagblad](https://www.ad.nl) & regional ADR sites like:
[BN DeStem](https://www.bndestem.nl) -
[Brabants Dagblad](https://www.bd.nl) -
[Eindhovens Dagblad](https://www.ed.nl) -
[Gelderlander](https://www.gelderlander.nl) -
[PZC](https://www.pzc.nl) -
[Stentor](https://www.destentor.nl) -
[Tubantia](https://tubantia.nl)\
[DeMorgen](https://www.demorgen.be) -
[Groene Amsterdammer](https://www.groene.nl) -
[NRC Handelsblad](https://www.nrc.nl) -
[Parool](https://www.parool.nl) -
[Telegraaf](https://www.telegraaf.nl) -
[Trouw](https://www.trouw.nl) -
[Tubantia](https://tubantia.nl) -
[Volkskrant](https://www.volkskrant.nl) -
[Vrij Nederland](https://www.vn.nl)
##### Spain

View File

@ -222,6 +222,21 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
});
}
// remove cookies for regional ADR sites of ad.nl (mainfest.json needs in permissions: <all_urls>)
if (isSiteEnabled({url: '.ad.nl'})) {
const ad_region_domains = ['bd.nl', 'ed.nl', 'tubantia.nl', 'bndestem.nl', 'pzc.nl', 'destentor.nl', 'gelderlander.nl'];
var domainVar = new URL(details.url).hostname.replace('www.', '');
if (ad_region_domains.includes(domainVar)) {
chrome.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
if (remove_cookies_select_drop['ad.nl'].includes(cookies[i].name)){
chrome.cookies.remove({url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
}
});
}
}
// 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}) || isSiteEnabled({url: header_referer})) && details.url.match(blockedRegexes[domain])) {

View File

@ -3,7 +3,6 @@
"American Affairs": "americanaffairsjournal.org",
"Baltimore Sun": "baltimoresun.com",
"Crain's Chicago Business": "chicagobusiness.com",
"Eindhovens Dagblad": "ed.nl",
"Dark Reading": "darkreading.com",
"L'Écho": "lecho.be",
"Los Angeles Business Journal": "labusinessjournal.com",
@ -17,6 +16,5 @@
"The Morning Call": "mcall.com",
"The News-Gazette": "news-gazette.com",
"The Sacramento Bee (free articles only)": "sacbee.com",
"Tubantia": "tubantia.nl",
"Winston-Salem Journal": "journalnow.com"
}