From 3931fb846d46c9b92074c365e67b9a859cf1283e Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 20 Mar 2024 19:25:52 +0100 Subject: [PATCH] Fix Newsweek.pl (css) --- changelog.txt | 1 + contentScript.js | 21 ++++++++++----------- sites.js | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/changelog.txt b/changelog.txt index 18f4196..50b3a73 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Post-release Add Blick.ch (Ringier Gruppe) Add CNN (regwall) Fix Expresso.pt (json) +Fix Newsweek.pl (css) Fix The Athletic (scroll) * v3.6.0.0 (2024-03-17) diff --git a/contentScript.js b/contentScript.js index 0eedc80..6c48073 100644 --- a/contentScript.js +++ b/contentScript.js @@ -4813,18 +4813,17 @@ else if (matchDomain('newsweek.com')) { } else if (matchDomain('newsweek.pl')) { - let clear_ads = function () { - window.setTimeout(function () { - let ads = document.querySelectorAll('[class^="pwAds"], .hide-for-paying, div#contentPremiumPlaceholder > span, div.onet-ad'); - hideDOMElement(...ads); - }, 2000); - } - func_post = function () { - clear_ads(); + let premium = document.querySelector('div.contentPremium[style]'); + if (premium) { + premium.removeAttribute('class'); + premium.removeAttribute('style'); } - let url = window.location.href; - getArchive(url, 'div#contentPremiumPlaceholder', '', 'div#article-content-body'); - clear_ads(); + let placeholder = document.querySelector('div#contentPremiumPlaceholder[class]'); + if (placeholder) + placeholder.removeAttribute('class'); + let ads = document.querySelectorAll('[class^="pwAds"], .hide-for-paying, div.onet-ad, div.bottomBar'); + console.log(ads); + hideDOMElement(...ads); } else if (matchDomain(['nola.com', 'theadvocate.com'])) { diff --git a/sites.js b/sites.js index 1cdfed3..f37fb42 100644 --- a/sites.js +++ b/sites.js @@ -1814,10 +1814,10 @@ var defaultSites = { domain: "newsweek.com", block_regex: /(js\.pelcro\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/ }, - "Newsweek.pl (fetch from archive.is)": { + "Newsweek.pl": { domain: "newsweek.pl", allow_cookies: 1, - cs_dompurify: 1 + block_regex: /cdn\.cxense\.com\// }, "NHST Media Group": { domain: "###_no_nhst_media", @@ -2982,7 +2982,7 @@ var defaultSites = { domain: "piano.io", allow_cookies: 1, block_regex_general: /\.piano\.io\/xbuilder\/experience\/execute/, - excluded_domains: ["piano.io", "asia.nikkei.com", "businessinsider.com.pl", "hbr.org", "japantimes.co.jp", "nacion.com", "onet.pl"] + excluded_domains: ["piano.io", "asia.nikkei.com", "businessinsider.com.pl", "hbr.org", "japantimes.co.jp", "nacion.com", "newsweek.pl", "onet.pl"] }, "Pico.tools": { domain: "pico.tools",