From 747d1d36cc941725ac708c702fcad22414ee5fa7 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 20 Nov 2023 18:58:56 +0100 Subject: [PATCH] Fix The Hill Times (ld_json_url) --- changelog.txt | 1 + contentScript.js | 28 +++++++--------------------- custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 3 ++- 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2302a86..2748a71 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Fix The Hill Times (ld_json_url) Update popup (fix toggle for custom flex sites) * v3.4.3.0 (2023-11-19) diff --git a/contentScript.js b/contentScript.js index 5a11d06..c5add02 100644 --- a/contentScript.js +++ b/contentScript.js @@ -4002,31 +4002,17 @@ else if (matchDomain('hbr.org')) { else if (matchDomain('hilltimes.com')) { function hilltimes_main(node) { - let paywall_banner = document.querySelector('div.paywallcont2'); - removeDOMElement(node, paywall_banner); - let json_script = document.querySelector('script.saswp-schema-markup-output'); - if (json_script) { - try { - let json = JSON.parse(json_script.text); - let json_text = json.filter(x => x.articleBody)[0].articleBody.replace(/\s{2,}/g, '\r\n\r\n'); - let article = document.querySelector('div#fadebg > p'); - if (article) { - article.innerText = parseHtmlEntities(json_text); - article.parentNode.removeAttribute('id'); - } - } catch (err) { - console.log(err); - } - } + getJsonUrl('div.paywallcont', '', 'div#entry-content'); } let paywall_sel = 'div.paywallcont'; let paywall = document.querySelector(paywall_sel); - if (paywall) { - hilltimes_main(paywall); - } else { - waitDOMElement(paywall_sel, 'DIV', hilltimes_main, false); + if (dompurify_loaded) { + if (paywall) + hilltimes_main(paywall); + else + waitDOMElement(paywall_sel, 'DIV', hilltimes_main, false); + csDoneOnce = true; } - csDoneOnce = true; window.setTimeout(function () { let banner = document.querySelector('section.hide_this_section'); hideDOMElement(banner); diff --git a/custom/manifest.json b/custom/manifest.json index a79badf..0227b04 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.3.1" + "version": "3.4.3.2" } diff --git a/manifest.json b/manifest.json index 536a3e3..d5a46d2 100644 --- a/manifest.json +++ b/manifest.json @@ -815,5 +815,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.3.1" + "version": "3.4.3.2" } diff --git a/sites.js b/sites.js index cfa1606..f3d3dff 100644 --- a/sites.js +++ b/sites.js @@ -2269,7 +2269,8 @@ var defaultSites = { domain: "hilltimes.com", allow_cookies: 1, block_regex: /\.hilltimes\.com\/.+\/js\/loadingoverlay\/loadingoverlay\.min\.js/, - useragent: "googlebot" + useragent: "googlebot", + cs_dompurify: 1 }, "The Hindu": { domain: "thehindu.com",