From 528f8c6d7b3d259f3a9add688534b82f14a57ec1 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 28 Dec 2023 21:58:27 +0100 Subject: [PATCH] Fix The Juggernaut --- changelog.txt | 1 + contentScript.js | 17 ++++++++++++----- custom/manifest.json | 2 +- manifest.json | 2 +- sites_updated.json | 8 ++++---- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/changelog.txt b/changelog.txt index 403c1637..677331a7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -10,6 +10,7 @@ Remove Haaretz Group (fix obsolete) Fix elDiario.es (amp-redirect) Fix Inc42 (css) Fix S&P Global (js-inline) +Fix The Juggernaut Update block general paywall script (Leaky-js-cookie) * v3.4.8.0 (2023-12-24) diff --git a/contentScript.js b/contentScript.js index 0121f1e0..c3c986a3 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1103,7 +1103,7 @@ else if (matchDomain(['ksta.de', 'rundschau-online.de'])) { } } } - }, 1000); + }, 2000); let banners = document.querySelectorAll('div.dm-slot, div[id^="taboola-feed"]'); hideDOMElement(...banners); } @@ -5054,22 +5054,28 @@ else if (matchDomain('theimpression.com')) { } else if (matchDomain(['thejuggernaut.com', 'jgnt.co'])) { - let paywall = pageContains('div.font-mono', /\Read this article and many more by subscribing today/); + let paywall = pageContains('div.font-mono', /(Read this article and many more by subscribing today|Join today to read the full story)/); if (paywall.length) { removeDOMElement(paywall[0].parentNode); let json_script = document.querySelector('script#__NEXT_DATA__'); if (json_script) { try { - let json = JSON.parse(json_script.innerText); + let json = JSON.parse(json_script.text); if (json && json.props.pageProps.post) { let url_next = json.query.slug; if (url_next && !window.location.pathname.includes(url_next)) refreshCurrentTab(); let pars = json.props.pageProps.post.fields.textEssay.fields.body.content; - let article = document.querySelector('div.opacity-50'); + window.setTimeout(function () { + let article = document.querySelector('div[class*="opacity-"]'); if (article) { article.innerHTML = ''; article.removeAttribute('class'); + let fade = document.querySelectorAll('div.bg-gradient-to-b'); + for (let elem of fade) + elem.removeAttribute('class'); + let modal = document.querySelector('div#headlessui-portal-root'); + removeDOMElement(modal); let par_first = true; function attach_text(sub_item, elem) { if (sub_item.value) { @@ -5117,7 +5123,7 @@ else if (matchDomain(['thejuggernaut.com', 'jgnt.co'])) { } for (let par of pars) { let elem = document.createElement('p'); - if (['paragraph', 'heading-1'].includes(par.nodeType)) { + if (par.nodeType.match(/^(paragraph|heading-\d)$/)) { attach_paragraph(par, elem); } else if (['blockquote'].includes(par.nodeType)) { if (par.content && par.content.length) { @@ -5177,6 +5183,7 @@ else if (matchDomain(['thejuggernaut.com', 'jgnt.co'])) { } } } + }, 1000); } else refreshCurrentTab(); } catch (err) { diff --git a/custom/manifest.json b/custom/manifest.json index 316c5b02..8b5d884c 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.8.5" + "version": "3.4.8.6" } diff --git a/manifest.json b/manifest.json index df4cf457..58d896b7 100644 --- a/manifest.json +++ b/manifest.json @@ -824,5 +824,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.8.5" + "version": "3.4.8.6" } diff --git a/sites_updated.json b/sites_updated.json index cb21066e..3a75115b 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -61,7 +61,7 @@ "domain": "haaretz.com", "allow_cookies": 1, "add_ext_link": "meta[property='og:url'][content*='/.']|article p", - "add_ext_link_type": "archive.is", + "add_ext_link_type": "google_search_tool", "upd_version": "3.4.7.7" }, "Haaretz Group": { @@ -73,12 +73,12 @@ ], "allow_cookies": 1, "add_ext_link": "meta[property='og:url'][content*='/.']|article p", - "add_ext_link_type": "archive.is", + "add_ext_link_type": "google_search_tool", "exception": [{ - "domain": "haaretz.co.il", + "domain": "themarker.com", "allow_cookies": 1, "add_ext_link": "meta[property='og:url'][content*='/.']|article p", - "add_ext_link_type": "google_search_tool" + "add_ext_link_type": "archive.is" } ] },