From 1ea1cfd62db904dddfb2a311a7299c714e7ed8fd Mon Sep 17 00:00:00 2001 From: CennoxX Date: Mon, 16 Jan 2023 07:49:29 +0000 Subject: [PATCH] Add Cellesche Zeitung --- README.md | 1 + changelog.txt | 1 + contentScript.js | 27 +++++++++++++++++++++++++++ custom/sites_custom.json | 6 ------ manifest.json | 3 ++- sites.js | 4 ++++ 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cb5a916..1579f49 100644 --- a/README.md +++ b/README.md @@ -512,6 +512,7 @@ Grouped in options:\ [Automobilwoche](https://www.automobilwoche.de) - [Badische Neueste Nachrichten](https://www.bnn.de) - [Berliner Zeitung](https://www.berliner-zeitung.de) - +[Cellesche Zeitung](https://www.cz.de) - [Cicero](https://www.cicero.de) - [Der Spiegel (link to archive.is)](https://www.spiegel.de) - [Der Tagesspiegel (link to archive.is)](https://www.tagesspiegel.de) - diff --git a/changelog.txt b/changelog.txt index 96cbe53..f8ad36f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Add Cellesche Zeitung * v3.0.1.0 (2023-01-15) Fix Inc42 diff --git a/contentScript.js b/contentScript.js index d7788d5..24b56d6 100644 --- a/contentScript.js +++ b/contentScript.js @@ -526,6 +526,33 @@ else if (matchDomain('cicero.de')) { removeDOMElement(...urban_ad_sign); } +else if (matchDomain('cz.de')) { + let paywall = document.querySelector('#erasmo'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article'); + if (article) { + article.classList.remove('news-read-not-allowed'); + fetch(window.location.href) + .then(response => { + if (response.ok) { + response.text().then(html => { + let parser = new DOMParser(); + let doc = parser.parseFromString(html, 'text/html'); + let content = document.querySelector('.field__items'); + let content_new = doc.querySelector('.field__items'); + if (content_new && content) { + content.parentNode.replaceChild(content_new, content); + } + }) + } + }); + } + } + let banner = document.querySelector('.newsletter-signup-wrapper'); + removeDOMElement(banner); +} + else if (matchDomain('faz.net')) { if (matchDomain('zeitung.faz.net')) { let paywall_z = document.querySelector('.c-red-carpet'); diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 9e65006..225fae3 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -63,12 +63,6 @@ "block_regex": "paywall\\.correiodopovo\\.com\\.br", "domain": "correiodopovo.com.br" }, - "Cz.de": { - "allow_cookies": 1, - "block_regex": "\\.cz\\.de\\/sites\\/default\\/files\\/js\\/js_.*\\.js", - "cs_code": "[{\"cond\":\"#erasmo\", \"rm_elem\":1, \"elems\":[{\"cond\":\"article\",\"rm_class\":\"news-read-not-allowed\"},{\"cond\":\".newsletter-signup-wrapper\",\"rm_elem\":1}]}]", - "domain": "cz.de" - }, "Dailyherald.com": { "allow_cookies": 1, "block_regex": "\\.tinypass\\.com", diff --git a/manifest.json b/manifest.json index 134fe93..470c06a 100644 --- a/manifest.json +++ b/manifest.json @@ -165,6 +165,7 @@ "*://*.curbed.com/*", "*://*.cw.com.tw/*", "*://*.cyclingtips.com/*", + "*://*.cz.de/*", "*://*.dailyadvertiser.com.au/*", "*://*.dailyliberal.com.au/*", "*://*.dailypress.com/*", @@ -719,5 +720,5 @@ "*://*.wallkit.net/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.0.1.0" + "version": "3.0.1.1" } diff --git a/sites.js b/sites.js index 05576a9..c84db0e 100644 --- a/sites.js +++ b/sites.js @@ -263,6 +263,10 @@ var defaultSites = { allow_cookies: 1, block_regex: /\.qiota\.com\// }, + "Cellesche Zeitung": { + domain: "cz.de", + allow_cookies: 1, + }, "Challenges": { domain: "challenges.fr", allow_cookies: 1,