From b50278756b08dda6c8fd18152afecdafe87be2f1 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 25 Oct 2021 20:18:48 +0200 Subject: [PATCH] Fix The Athletic (timing) --- changelog.txt | 1 + contentScript.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 769d66f..1a0d4e9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Fix Stratfor (forecasts) +Fix The Athletic (timing) * v2.4.1.0 (2021-10-24) Add Elle.fr diff --git a/contentScript.js b/contentScript.js index c649434..9ca2388 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1436,11 +1436,13 @@ else if (matchDomain('the-tls.co.uk')) { else if (matchDomain(['theathletic.com', 'theathletic.co.uk'])) { if (!window.location.href.includes('?amp')) { - let paywall = document.querySelectorAll('div#paywall-container, div[subscriptions-action="subscribe"]', 'a.headline-paywall'); + let paywall = document.querySelectorAll('div#paywall-container, div[subscriptions-action="subscribe"], a.headline-paywall'); let amphtml = document.querySelector('link[rel="amphtml"]'); if (paywall && amphtml) { removeDOMElement(...paywall); - window.location.href = amphtml.href; + window.setTimeout(function () { + window.location.href = amphtml.href; + }, 500); // Delay (in milliseconds) } } else { let subscr_sections = document.querySelectorAll('[subscriptions-section="content"]');