From 2e3b9c5e46c505d92a2b5b0e30ebd479b1151ddb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 3 Dec 2022 08:24:16 +0100 Subject: [PATCH] Fix Quotidiano.net (no amp) --- changelog.txt | 1 + contentScript.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index aaacfe23..d4d7e288 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,6 +9,7 @@ Remove BusinessPost.ie (fix obsolete) Remove Philonomist (fix obsolete) Fix Australian Community Media (identify on url) Fix Groupe Centre France (text) +Fix Quotidiano.net (no amp) Fix The Chronicle of Higher Education (css) * v2.9.5.0 (2022-11-27) diff --git a/contentScript.js b/contentScript.js index c55666b2..e0b0f154 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1855,10 +1855,12 @@ else if (matchDomain(it_ilmessaggero_domains)) { else if (matchDomain(it_quotidiano_domains)) { if (window.location.pathname.endsWith('/amp')) { - amp_unhide_access_hide('="c.customGranted"', '="NOT c.customGranted"', 'amp-ad, amp-fx-flying-carpet'); + amp_unhide_access_hide('="c.customGranted"', '="NOT c.customGranted"', 'amp-ad, amp-embed, amp-fx-flying-carpet, .watermark-adv'); } else { let paywall = document.querySelector('div[data-testid="paywall-container"]'); let amphtml = document.querySelector('link[rel="amphtml"]'); + if (!amphtml) + amphtml = {href: window.location.pathname + '/amp'}; if (paywall && amphtml) { removeDOMElement(paywall); window.location.href = amphtml.href;