From 62a41c7b62069a747043c6469f967d299800c114 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 20 Feb 2021 10:18:01 +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 c04d891..dbaed97 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 incognito window (cookies) diff --git a/contentScript.js b/contentScript.js index e63358d..3ed25e3 100755 --- 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')) {