diff --git a/README.md b/README.md index 94ca6e4..70467c5 100755 --- a/README.md +++ b/README.md @@ -355,7 +355,7 @@ Funke Mediengruppe sites like [Westdeutsche Allgemeine Zeitung](https://www.waz.de) - [Westfalenpost](https://www.wp.de) - [Westfälische Rundschau](https://www.wr.de)\ -Madsack Mediengruppe sites like +Madsack Mediengruppe sites like (opt-in to custom sites for unlisted) [Hannoversche Allgemeine Zeitung](https://www.haz.de) - [Kieler Nachrichten](https://www.kn-online.de) - [Leipziger Volkszeitung](https://www.lvz.de) - diff --git a/background.js b/background.js index c4601b9..fb18ba8 100755 --- a/background.js +++ b/background.js @@ -945,6 +945,19 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { } } + // block script for additional Madsack/RND sites (opt-in to custom sites) + var de_rnd_domain = (matchUrlDomain('rndtech.de', details.url) && ['script'].includes(details.type) && !matchUrlDomain(de_madsack_domains.concat(['madsack.de', 'madsack-medien-campus.de', 'rnd.de']), header_referer) && enabledSites.includes('###_de_madsack')); + if (de_rnd_domain) { + let rnd_domain = urlHost(header_referer).replace(/^(www|m)\./, ''); + if (!de_madsack_domains.includes(rnd_domain)) { + allow_cookies.push(rnd_domain); + blockedRegexes[rnd_domain] = /(cdn\.cxense\.com\/|\.tinypass\.com\/)/; + de_madsack_domains.push(rnd_domain); + if (!enabledSites.includes(rnd_domain)) + enabledSites.push(rnd_domain); + } + } + // block external javascript for custom sites (optional) var domain_blockjs_ext = matchUrlDomain(block_js_custom_ext, header_referer); if (domain_blockjs_ext && !matchUrlDomain(domain_blockjs_ext, details.url) && details.type === 'script' && isSiteEnabled({url: header_referer})) { diff --git a/changelog.txt b/changelog.txt index 5d2becf..1ed8c68 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Add Il Giorno (Italy) Add L'Express (France) Add La Nazione (Italy) Remove Rheinische Post Mediengruppe (obsolete) +Fix-update Madsack Mediengruppe (opt-in to custom sites for unlisted) Fix-update NyTeknik (images) Fix-update Repubblica.it Update block TinyPass (cdn only) diff --git a/contentScript.js b/contentScript.js index a1dd2b8..74b7a08 100755 --- a/contentScript.js +++ b/contentScript.js @@ -317,31 +317,6 @@ else if (matchDomain(de_funke_media_domains)) { sessionStorage.setItem('deobfuscate', 'true'); } -else if (domain = matchDomain(de_madsack_domains)) { - let url = window.location.href; - if (!url.includes(domain + '/amp/')) { - let paidcontent_intro = document.querySelector('div.pdb-article-body-paidcontentintro'); - if (paidcontent_intro) { - paidcontent_intro.classList.remove('pdb-article-body-paidcontentintro'); - let json_script = document.querySelector('div.pdb-article > script[type="application/ld+json"]'); - let json_text = JSON.parse(json_script.text).articleBody; - if (json_text) { - let pdb_richtext_field = document.querySelectorAll('div.pdb-richtext-field'); - if (pdb_richtext_field[1]) - pdb_richtext_field[1].innerText = json_text; - } - let paidcontent_reg = document.querySelector('div.pdb-article-paidcontent-registration'); - removeDOMElement(paidcontent_reg); - } - } else { - let subscr_sections = document.querySelectorAll('section[subscriptions-section="content"]'); - for (let subscr_section of subscr_sections) - subscr_section.removeAttribute('subscriptions-section'); - let amp_ads = document.querySelectorAll('.pdb-ad-container'); - removeDOMElement(...amp_ads); - } -} - else if (matchDomain('deutsche-wirtschafts-nachrichten.de')) { window.setTimeout(function () { let hardpay = document.querySelector('.hardpay'); @@ -549,6 +524,31 @@ else if (matchDomain('sueddeutsche.de')) { }, 500); // Delay (in milliseconds) } +else if ((domain = matchDomain(de_madsack_domains)) || document.querySelector('link[rel="preload"][href="https://static.rndtech.de/cmp/1.x.x.js"]')) { + let url = window.location.href; + if (!url.includes(domain + '/amp/')) { + let paidcontent_intro = document.querySelector('div.pdb-article-body-paidcontentintro'); + if (paidcontent_intro) { + paidcontent_intro.classList.remove('pdb-article-body-paidcontentintro'); + let json_script = document.querySelector('div.pdb-article > script[type="application/ld+json"]'); + let json_text = JSON.parse(json_script.text).articleBody; + if (json_text) { + let pdb_richtext_field = document.querySelectorAll('div.pdb-richtext-field'); + if (pdb_richtext_field[1]) + pdb_richtext_field[1].innerText = json_text; + } + let paidcontent_reg = document.querySelector('div.pdb-article-paidcontent-registration'); + removeDOMElement(paidcontent_reg); + } + } else { + let subscr_sections = document.querySelectorAll('section[subscriptions-section="content"]'); + for (let subscr_section of subscr_sections) + subscr_section.removeAttribute('subscriptions-section'); + let amp_ads = document.querySelectorAll('.pdb-ad-container'); + removeDOMElement(...amp_ads); + } +} + else noMatch = true; diff --git a/manifest.json b/manifest.json index 1f1badb..78d4dd9 100755 --- a/manifest.json +++ b/manifest.json @@ -488,5 +488,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.7.6" + "version": "2.1.7.7" } \ No newline at end of file