From b79721d2267aa6e06e566994d7ce78732f0a1c01 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 2 May 2022 17:29:37 +0200 Subject: [PATCH] Add group Mediahuis Noord --- README.md | 7 ++++--- background.js | 6 ++++++ changelog.txt | 1 + contentScript.js | 9 ++------- manifest.json | 1 + sites.js | 19 +++++++++---------- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 05268a9..2d90976 100644 --- a/README.md +++ b/README.md @@ -543,14 +543,12 @@ Grouped in options:\ [La Nazione](https://www.lanazione.it) ##### Netherlands/Flanders -[Dagblad van het Noorden](https://www.dvhn.nl) - [De Morgen](https://www.demorgen.be) - [Financieele Dagblad](https://fd.nl) - [Follow the Money](https://www.ftm.nl) - [Groene Amsterdammer](https://www.groene.nl) - [Humo](https://www.humo.be) - [Knack](https://www.knack.be) - -[Leeuwarder Courant](https://www.lc.nl) - [NRC Handelsblad](https://www.nrc.nl) - [Parool](https://www.parool.nl) - [Telegraaf](https://www.telegraaf.nl) - @@ -564,7 +562,10 @@ Grouped in options:\ [Haarlems Dagblad](https://www.haarlemsdagblad.nl) - [Leidsch Dagblad](https://www.leidschdagblad.nl) - [IJmuider Courant](https://www.ijmuidercourant.nl) - -[De Gooi- en Eemlander](https://www.gooieneemlander.nl) +[De Gooi- en Eemlander](https://www.gooieneemlander.nl)\ +*Mediahuis Noord* sites like (opt-in to custom sites for unlisted):\ +[Dagblad van het Noorden](https://www.dvhn.nl) - +[Leeuwarder Courant](https://www.lc.nl) ##### Portugal [Correio da Manhã](https://www.cmjornal.pt) - diff --git a/background.js b/background.js index 315a4b8..071dc95 100644 --- a/background.js +++ b/background.js @@ -810,6 +810,12 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { var fi_sanoma_sndp_domain = (matchUrlDomain('sanoma-sndp.fi', details.url) && ['xmlhttprequest'].includes(details.type) && !matchUrlDomain(fi_sanoma_domains, header_referer) && enabledSites.includes('###_fi_sanoma')); if (fi_sanoma_sndp_domain) fi_sanoma_domains = customAddRules(fi_sanoma_domains, true, '', 'googlebot'); + } else if (header_referer_hostname.endsWith('.nl')) { + // block Evolok for Mediahuis Noord sites (opt-in to custom sites) + var nl_mediahuis_noord_domains = []; + var nl_mediahuis_noord_domain = (matchUrlDomain('ndcmediagroep.nl', details.url) && ['script'].includes(details.type) && !matchUrlDomain(nl_mediahuis_noord_domains, header_referer) && enabledSites.includes('###_nl_mediahuis_noord')); + if (nl_mediahuis_noord_domain) + nl_mediahuis_noord_domains = customAddRules(nl_mediahuis_noord_domains, true, blockedRegexes['lc.nl']); } else if (header_referer_hostname.match(/\.(ca|com|org)$/)) { // block TinyPass for Postmedia Network sites var ca_postmedia_domains = grouped_sites['###_ca_postmedia']; diff --git a/changelog.txt b/changelog.txt index 974cb8c..dadcd5c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Add group Mediahuis Noord (opt-in to custom sites for unlisted) * v2.6.7.0 (2022-05-01) Add Puck.news diff --git a/contentScript.js b/contentScript.js index 5592753..6b8dd6c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1799,14 +1799,9 @@ else if (matchDomain(['knack.be', 'levif.be'])) { } } -else if (matchDomain(["lc.nl", "dvhn.nl"])) { - document.addEventListener('DOMContentLoaded', () => { - if (window.location.href.includes('?')) - window.location.href = window.location.href.split('?')[0]; - }); +else if (matchDomain(['lc.nl', 'dvhn.nl'])) { let top_ad = document.querySelector('.top__ad'); - let plus = document.querySelector('.plusJustRead'); - removeDOMElement(top_ad, plus); + removeDOMElement(top_ad); } else if (matchDomain(nl_mediahuis_region_domains)) { diff --git a/manifest.json b/manifest.json index 11848d7..a2f2f92 100644 --- a/manifest.json +++ b/manifest.json @@ -657,6 +657,7 @@ "*://*.mcclatchy-wires.com/*", "*://*.mcclatchyinteractive.com/*", "*://*.natgeofe.com/*", + "*://*.ndcmediagroep.nl/*", "*://*.nyt.com/*", "*://*.pasedigital.cl/*", "*://*.postmedia.digital/*", diff --git a/sites.js b/sites.js index bdd9f95..c0f8f00 100644 --- a/sites.js +++ b/sites.js @@ -282,11 +282,6 @@ var defaultSites = { } ] }, - "Dagblad van het Noorden": { - domain: "dvhn.nl", - allow_cookies: 1, - block_regex: /\.evolok\.net\// - }, "Dagens Industri": { domain: "di.se", allow_cookies: 1, @@ -1003,11 +998,6 @@ var defaultSites = { allow_cookies: 1, block_regex: /(api\.bntech\.io\/js\/|\.com\/shared-content\/art\/tncms\/user\/user\.js|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/ }, - "Leeuwarder Courant": { - domain: "lc.nl", - allow_cookies: 1, - block_regex: /\.evolok\.net\// - }, "Les Échos": { domain: "lesechos.fr", allow_cookies: 1, @@ -1109,6 +1099,15 @@ var defaultSites = { ], allow_cookies: 1 }, + "Mediahuis Noord": { + domain: "###_nl_mediahuis_noord", + group: [ + "dvhn.nl", + "lc.nl" + ], + allow_cookies: 1, + block_regex: /\.evolok\.net\// + }, "MediaNama": { domain: "medianama.com", allow_cookies: 1