From a9a051f5a8e50b80165d43acab0d2237562683bd Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 6 Aug 2022 10:17:45 +0200 Subject: [PATCH] Fix Tagesspiegel.de (css) --- changelog.txt | 2 +- contentScript.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 893b23fa..44607976 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,11 +6,11 @@ Add Limburger.nl Add Standaard.be Add Substack Add SuomenSotilas.fi +Add Tagesspiegel.de Add Welt.de Add Wiwo.de Fix Australian Community Media (css) Fix Spiegel.de (Google webcache) -Add Tagesspiegel.de Fix The Athletic (css & amp) Fix TheTimes.co.uk (Google webcache) Grouping DPG Media (not ADR) diff --git a/contentScript.js b/contentScript.js index 5f878990..8a42643f 100644 --- a/contentScript.js +++ b/contentScript.js @@ -731,12 +731,17 @@ else if (matchDomain('spiegel.de')) { else if (matchDomain('tagesspiegel.de')) { let url = window.location.href; - let paywall = document.querySelector('div.Rc6, .ts-paywall-blurred'); + let paywall = document.querySelector('div.article--paid > div, .ts-paywall-blurred'); if (paywall) { removeDOMElement(paywall); csDoneOnce = true; let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0]; - replaceDomElementExt(url_cache, true, false, 'div.Af, [class*="ts-paywall"]'); + replaceDomElementExt(url_cache, true, false, 'article, [class*="ts-paywall"]'); + window.setTimeout(function () { + let ads = document.querySelectorAll('div[data-mobile-id]'); + for (let elem of ads) + removeDOMElement(elem.parentNode); + }, 1000); } }