From 0e3686f0e48b74b988a415dc1adcc86ef7d8d6b5 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 28 Mar 2021 16:05:06 +0200 Subject: [PATCH] Add Nordwest Zeitung (Germany) --- README.md | 1 + background.js | 4 +++- changelog.txt | 1 + contentScript.js | 27 ++++++--------------------- manifest.json | 3 ++- sites.js | 1 + 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 47a37e8..07698c9 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,7 @@ Groupe Rossel sites (grouped in options) like [Kurier.at](https://kurier.at) - [Mitteldeutsche Zeitung](https://www.mz-web.de) - [Neue Osnabrücker Zeitung](https://www.noz.de]) - +[Nordwest Zeitung](https://www.nwzonline.de) - [Piqd.de](https://www.piqd.de) - [Rhein-Zeitung](https://www.rhein-zeitung.de) - [Ruhr Nachrichten](https://www.ruhrnachrichten.de) - diff --git a/background.js b/background.js index 644e9ca..b584500 100644 --- a/background.js +++ b/background.js @@ -105,6 +105,7 @@ var allow_cookies_default = [ 'noordhollandsdagblad.nl', 'nouvelobs.com', 'noz.de', + 'nwzonline.de', 'nybooks.com', 'nytimes.com', 'nzz.ch', @@ -325,6 +326,7 @@ var blockedRegexes = { 'newsweek.com': /js\.pelcro\.com\//, 'newyorker.com': /\.newyorker\.com\/verso\/static\/presenter-articles.+\.js/, 'noz.de': /cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|fx-flying-carpet)-.+\.js/, + 'nwzonline.de': /cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|fx-flying-carpet)-.+\.js/, 'nytimes.com': /(meter-svc\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js)/, 'observador.pt': /\.tinypass\.com\//, 'parismatch.com': /\.poool\.fr\//, @@ -938,7 +940,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let usa_mw_site = (matchUrlDomain('wsj.net', details.url) && matchUrlDomain('marketwatch.com', header_referer)); allow_ext_source = allow_ext_source || inkl_site || cl_elmerc_site || es_elesp_site || it_repubblica_site || uk_nlr_site || usa_discmag_site || usa_mw_site; - bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'seekingalpha.com', 'shz.de', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, de_rp_medien_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains), header_referer)); + bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'seekingalpha.com', 'shz.de', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, de_rp_medien_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains), header_referer)); } if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_apn_site && !au_swm_site) { diff --git a/changelog.txt b/changelog.txt index 4c31bb9..19729be 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Aachener Zeitung (Germany) Add Apollo Magazine +Add Nordwest Zeitung (Germany) Fix-update group McClatchy (opt-in to custom sites for unlisted) Fix-update Wired (Googlebot) Fix-update WSJ (option to disable Googlebot; http error 500) diff --git a/contentScript.js b/contentScript.js index a35034a..2529d61 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1859,22 +1859,6 @@ else if (matchDomain('lavanguardia.com')) { removeDOMElement(paywall, infinite_loading); } -else if (matchDomain(['shz.de', 'svz.de'])) { - let paywall = document.querySelector('.paywall'); - removeDOMElement(paywall); - let url = window.location.href; - if (!url.includes('-amp.html')) { - if (paywall) - window.location.href = url.replace('.html', '-amp.html'); - } else { - let div_hidden = document.querySelector('div[amp-access="NOT data.reduced"]'); - if (div_hidden) - div_hidden.removeAttribute('amp-access-hide'); - } - let amp_ads = document.querySelectorAll('amp-ad, amp-embed, #flying-carpet-wrapper'); - removeDOMElement(...amp_ads); -} - else if (matchDomain('sudouest.fr')) { let url = window.location.href; let paywall = document.querySelector('.article-premium-footer'); @@ -2093,15 +2077,16 @@ else if (matchDomain('time.com')) { body.setAttribute('style', 'position:relative !important;'); } -else if (matchDomain('noz.de')) { +else if (matchDomain(['noz.de', 'nwzonline.de', 'shz.de', 'svz.de'])) { let url = window.location.href; - let paywall = document.querySelector('.paywall'); - if (url.includes('?amp')) { + let paywall = document.querySelector('.paywall, .story--premium__container'); + if (url.includes('?amp') || url.includes('-amp.html')) { let subscriber = document.querySelector('div[amp-access="NOT data.reduced"]'); if (subscriber) subscriber.removeAttribute('amp-access-hide'); - let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); - removeDOMElement(...amp_ads); + let non_subscriber = document.querySelector('div[amp-access="data.reduced"]'); + let amp_ads = document.querySelectorAll('amp-ad, amp-embed, #flying-carpet-wrapper'); + removeDOMElement(non_subscriber, ...amp_ads); } else { let amphtml = document.querySelector('link[rel="amphtml"]'); if (paywall && amphtml) { diff --git a/manifest.json b/manifest.json index 3fdca0e..1649238 100644 --- a/manifest.json +++ b/manifest.json @@ -313,6 +313,7 @@ "*://*.nrpyrenees.fr/*", "*://*.nrz.de/*", "*://*.ntnews.com.au/*", + "*://*.nwzonline.de/*", "*://*.nybooks.com/*", "*://*.nydailynews.com/*", "*://*.nymag.com/*", @@ -494,5 +495,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.3.5" + "version": "2.1.3.6" } \ No newline at end of file diff --git a/sites.js b/sites.js index 4b09447..eef4149 100644 --- a/sites.js +++ b/sites.js @@ -172,6 +172,7 @@ var defaultSites = "Newsweek": "newsweek.com", "Nikkei Asian Review": "asia.nikkei.com", "Noordhollands Dagblad": "noordhollandsdagblad.nl", + "Nordwest Zeitung": "nwzonline.de", "NRC Handelsblad": "nrc.nl", "O Estado de S. Paulo": "estadao.com.br", "O Globo": "globo.com",