From e7dcdd72b5523fd8013377a70e5fde79e3ce05db Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 24 Jan 2024 09:45:56 +0100 Subject: [PATCH] Add Newsweek.pl --- README.md | 1 + changelog.txt | 1 + contentScript.js | 15 +++++++++++++++ custom/manifest.json | 2 +- manifest.json | 3 ++- sites.js | 5 +++++ sites_updated.json | 7 +++++++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8365cc31..edba2394 100644 --- a/README.md +++ b/README.md @@ -776,6 +776,7 @@ Grouped in options:\ ##### Poland [Business Insider Polska](https://businessinsider.com.pl) - +[Newsweek.pl](https://www.newsweek.pl) - [Rzeczpospolita](https://www.rp.pl) ##### Portugal diff --git a/changelog.txt b/changelog.txt index 0710383a..0f7a1472 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Add Newsweek.pl (fetch from archive.is) Remove Abendblatt.de (Funke; fix obsolete) Fix Grupo Abril (js) Fix LesEchos.fr diff --git a/contentScript.js b/contentScript.js index 8c0d7d0e..7cf592e4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -4399,6 +4399,21 @@ else if (matchDomain('newsweek.com')) { hideDOMElement(...ads); } +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 url = window.location.href; + getArchive(url, 'div#contentPremiumPlaceholder', '', 'div#article-content-body'); + clear_ads(); +} + else if (matchDomain(['nola.com', 'theadvocate.com'])) { if (window.location.pathname.endsWith('.amp.html')) { let body_hidden = document.querySelector('.site-container'); diff --git a/custom/manifest.json b/custom/manifest.json index d881e109..e91d6673 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.5.2.1" + "version": "3.5.2.2" } diff --git a/manifest.json b/manifest.json index 00051f98..537f78ea 100644 --- a/manifest.json +++ b/manifest.json @@ -499,6 +499,7 @@ "*://*.newsobserver.com/*", "*://*.newstatesman.com/*", "*://*.newsweek.com/*", + "*://*.newsweek.pl/*", "*://*.newyorker.com/*", "*://*.nhregister.com/*", "*://*.niagarafallsreview.ca/*", @@ -839,5 +840,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.5.2.1" + "version": "3.5.2.2" } diff --git a/sites.js b/sites.js index cd7589f6..d7b85585 100644 --- a/sites.js +++ b/sites.js @@ -1755,6 +1755,11 @@ 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)": { + domain: "newsweek.pl", + allow_cookies: 1, + cs_dompurify: 1 + }, "NHST Media Group": { domain: "###_no_nhst_media", group: [ diff --git a/sites_updated.json b/sites_updated.json index 379bc020..235abf4c 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -111,6 +111,13 @@ "useragent": "googlebot", "upd_version": "3.5.0.2" }, + "Newsweek.pl": { + "domain": "newsweek.pl", + "allow_cookies": 1, + "add_ext_link": "div#contentPremiumPlaceholder|div#article-content-body", + "add_ext_link_type": "archive.is", + "upd_version": "3.5.2.2" + }, "Stratfor": { "domain": "stratfor.com", "allow_cookies": 1,