From 4acdf3aee602f5ec70c1f04e9a0364905cb98e78 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 20 Feb 2021 10:18:12 +0100 Subject: [PATCH] Fix-update La Croix (timing) --- changelog.txt | 1 + contentScript.js | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/changelog.txt b/changelog.txt index 45074a95..9960e7b2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add Daily Nation (Kenya) Add Schleswig-Holsteinischer Zeitungsverlag (Germany) Add Sports Illustrated +Fix-update La Croix (timing) Grouping Repubblica.it sites (rules only) Fix popup (update notification; GitLab CORS issue) Fix private window (cookies/popup) diff --git a/contentScript.js b/contentScript.js index e63358d5..3ed25e34 100644 --- a/contentScript.js +++ b/contentScript.js @@ -223,6 +223,23 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam } } +else if (matchDomain('la-croix.com')) { + let url = window.location.href; + if (!url.includes('la-croix.com/amp/')) { + let paywall_host_param = document.querySelector('#paywall-host-param'); + removeDOMElement(paywall_host_param); + let show_paywall = document.querySelector('#showPayWall'); + if (show_paywall) + window.setTimeout(function () { + window.location.reload(true); + }, 500); + } else { + let paywall_block = document.querySelector('#paywall_block'); + let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); + removeDOMElement(paywall_block, ...amp_ads); + } +} + else if (matchDomain('rep.repubblica.it')) { window.setTimeout(function () { if (window.location.href.includes('/pwa/')) { @@ -1724,18 +1741,6 @@ else if (matchDomain("elperiodico.com")) { } } -else if (matchDomain('la-croix.com')) { - let url = window.location.href; - if (!url.includes('la-croix.com/amp/')) { - let paywall_host_param = document.querySelector('#paywall-host-param'); - removeDOMElement(paywall_host_param); - } else { - let paywall_block = document.querySelector('#paywall_block'); - let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); - removeDOMElement(paywall_block, ...amp_ads); - } -} - else if (matchDomain('lasegunda.com')) { let url = window.location.href; if (url.includes('digital.lasegunda.com/mobile')) {