diff --git a/README.md b/README.md index c795990..cbe7d76 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,7 @@ Grouped in options:\ [Frankfurter Allgemeine Zeitung](https://www.faz.net) - [Freie Presse](https://www.freiepresse.de) - [Jacobin Magazin](https://jacobin.de) - +[Junge Freiheit](https://jungefreiheit.de) - [Kölner Stadt-Anzeiger](https://www.ksta.de) - [Kölnische Rundschau](https://www.rundschau-online.de) - [Krautreporter](https://krautreporter.de) - diff --git a/changelog.txt b/changelog.txt index 77aad28..bf0f47f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Post-release Add Bhaskar (India) Add Granta Magazine (UK) Add Interesting Engineering +Add JungeFreiheit.de Add Vn.at Fix Media Group Westfalen Fix Mediahuis Nederland Regional (js) diff --git a/contentScript.js b/contentScript.js index 67f8d4f..0be1781 100644 --- a/contentScript.js +++ b/contentScript.js @@ -927,6 +927,39 @@ else if (matchDomain('jacobin.de')) { } } +else if (matchDomain('jungefreiheit.de')) { + let paywall = document.querySelector('div.paywall-teaser-box'); + if (paywall && dompurify_loaded) { + removeDOMElement(paywall); + let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]'); + if (json_url_dom) { + let json_url = json_url_dom.href; + fetch(json_url) + .then(response => { + if (response.ok) { + response.json().then(json => { + let json_text = json.content.rendered; + let content = document.querySelector('div.elementor-widget-container > p'); + if (json_text && content) { + let parser = new DOMParser(); + let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); + let content_new = doc.querySelector('div'); + content.parentNode.replaceChild(content_new, content); + } + }); + } + }); + } + let fade = document.querySelector('div[style*="background-image: url"]'); + removeDOMElement(fade); + } + window.setTimeout(function () { + let banners = document.querySelectorAll('div > small'); + for (let elem of banners) + hideDOMElement(elem.parentNode); + }, 1000); +} + else if (matchDomain('krautreporter.de')) { let paywall = document.querySelector('.js-article-paywall'); if (paywall) { @@ -1173,7 +1206,6 @@ else if (matchDomain('vol.at')) { if (paywall && dompurify_loaded) { paywall.removeAttribute('class'); if (!paywall.hasChildNodes()) { - console.log('empty'); let json_script = document.querySelector('script#externalPostDataNode'); if (json_script) { try { @@ -4403,7 +4435,7 @@ else if (matchDomain('puck.news')) { let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); content.innerHTML = ''; let content_new = doc.querySelector('div'); - content.appendChild(content_new, content); + content.appendChild(content_new); } }); } @@ -4734,7 +4766,7 @@ else if (matchDomain('theamericanconservative.com')) { let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); let content_new = doc.querySelector('div'); content.innerHTML = ''; - content.appendChild(content_new, content); + content.appendChild(content_new); } }); } @@ -5205,7 +5237,7 @@ else if (matchDomain('thewrap.com')) { let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); content.innerHTML = ''; let content_new = doc.querySelector('div'); - content.appendChild(content_new, content); + content.appendChild(content_new); } }); } diff --git a/custom/manifest.json b/custom/manifest.json index eb2b2ef..100d0ad 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -54,5 +54,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.3.6.7" + "version": "3.3.6.8" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 1c75349..da24234 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -732,6 +732,16 @@ "domain": "utilityweek.co.uk", "useragent": "googlebot" }, + "Van-magazin.de": { + "allow_cookies": 1, + "domain": "van-magazin.de", + "ld_json_url": "div.newspack-metered-paywall-block|div.entry-content" + }, + "Van-magazine.com": { + "allow_cookies": 1, + "domain": "van-magazine.com", + "ld_json_url": "div.newspack-metered-paywall-block|div.entry-content" + }, "Washingtontimes.com": { "allow_cookies": 1, "block_regex": "\\.tinypass\\.com", diff --git a/manifest.json b/manifest.json index 721a06c..ddb758c 100644 --- a/manifest.json +++ b/manifest.json @@ -362,6 +362,7 @@ "*://*.journalstar.com/*", "*://*.jpost.com/*", "*://*.jsonline.com/*", + "*://*.jungefreiheit.de/*", "*://*.kansas.com/*", "*://*.kansascity.com/*", "*://*.kentucky.com/*", @@ -805,5 +806,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.3.6.7" + "version": "3.3.6.8" } diff --git a/sites.js b/sites.js index ce38d3a..83b70a4 100644 --- a/sites.js +++ b/sites.js @@ -1177,6 +1177,11 @@ var defaultSites = { allow_cookies: 1, cs_dompurify: 1 }, + "Junge Freiheit": { + domain: "jungefreiheit.de", + allow_cookies: 1, + cs_dompurify: 1 + }, "Kölner Stadt-Anzeiger": { domain: "ksta.de", allow_cookies: 1, diff --git a/sites_updated.json b/sites_updated.json index 1860a39..2938192 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -50,6 +50,12 @@ "ld_json_url": "div.article-sign-up-container|div.article-excerpt", "upd_version": "3.3.6.6" }, + "Junge Freiheit": { + "domain": "jungefreiheit.de", + "allow_cookies": 1, + "ld_json_url": "div.paywall-teaser-box|div.elementor-widget-container > p", + "upd_version": "3.3.6.8" + }, "Mediahuis Nederland Regional": { "domain": "###_nl_mediahuis_region", "group": [