From a00b6f9afb8b38a67e5d94872655f9dd7a3870fb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 5 Apr 2020 08:33:24 +0200 Subject: [PATCH] Fix-update Telegraaf.nl (FF meta-refresh) --- contentScript.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contentScript.js b/contentScript.js index fb1fcd6..bb69273 100644 --- a/contentScript.js +++ b/contentScript.js @@ -32,7 +32,7 @@ else if (matchDomain("thesaturdaypaper.com.au")) { } else if (matchDomain('rep.repubblica.it')) { - setTimeout(function () { + window.setTimeout(function () { if (window.location.href.includes('/pwa/')) { window.location.href = window.location.href.replace('/pwa/', '/ws/detail/'); } @@ -57,6 +57,12 @@ else if (matchDomain('telegraaf.nl')) { if (window.location.href.startsWith('https://www.telegraaf.nl/error?ref=/')) { window.location.href = window.location.href.split('&')[0].replace('error?ref=/', ''); } + let refresh = document.querySelector('div[id="content"] > meta[http-equiv="refresh"]'); + if (refresh) { + window.setTimeout(function () { + window.location.reload(true); + }, 500); + } let article_wrapper = document.querySelector('.ArticlePageWrapper__uid'); let spotx_banner = document.querySelector('.ArticleBodyBlocks__inlineArticleSpotXBanner'); let paywall = document.querySelector('.PopupBackdrop__block'); @@ -100,7 +106,7 @@ else if (matchDomain("washingtonpost.com")) { const free_button = document.querySelector('.gdpr-consent-container .continue-btn.button.free'); if (free_button) free_button.click(); - setTimeout(function () { + window.setTimeout(function () { const gdprcheckbox = document.querySelector('.gdpr-consent-container .consent-page:not(.hide) #agree'); if (gdprcheckbox) { gdprcheckbox.checked = true; @@ -238,7 +244,7 @@ else if (matchDomain("economist.com")) { const advert = document.querySelector('.advert'); const wrapper = document.getElementById('bottom-page-wrapper'); removeDOMElement(subscribe, advert, wrapper); - setTimeout(function () { + window.setTimeout(function () { const paywall = document.querySelector('.layout-article-regwall'); ; if (paywall) { window.location.reload(true);