From fd9f1bd2bcd421b2505f892dae02065205405cdf Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 19 Apr 2021 19:14:43 +0200 Subject: [PATCH] Fix-update Repubblica.it --- changelog.txt | 1 + contentScript.js | 7 ++++--- manifest.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9157db1..40db1f6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release Fix-update NyTeknik (images) +Fix-update Repubblica.it * v2.1.7.0 (2021-04-18) Add NyTeknik (Sweden) diff --git a/contentScript.js b/contentScript.js index 079109d..91d4829 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1077,11 +1077,12 @@ else if (matchDomain('rep.repubblica.it')) { else if (domain = matchDomain(it_repubblica_domains)) { let url = window.location.href; if (!url.includes('/amp/')) { - let premium = document.querySelector('.paywall-adagio'); + let premium = document.querySelector('.paywall-adagio, #paywall'); removeDOMElement(premium); window.setTimeout(function () { - if (premium && (domain === 'lastampa.it')) - window.location.href = url.split('?')[0] + '/amp/'; + let amphtml = document.querySelector('link[rel="amphtml"]'); + if (premium && amphtml && (['lastampa.it', 'repubblica.it'].includes(domain))) + window.location.href = amphtml.href; let article_body = document.querySelector('div#article-body[style]'); if (article_body) article_body.removeAttribute('style'); diff --git a/manifest.json b/manifest.json index d68c04d..79f7ae9 100755 --- a/manifest.json +++ b/manifest.json @@ -491,5 +491,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.7.1" + "version": "2.1.7.2" } \ No newline at end of file