From e5c8ff4426bf8dd16efd8cea329bb75a328abadb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 5 Apr 2022 18:05:13 +0200 Subject: [PATCH] Fix The Hill Times (text) --- changelog.txt | 1 + contentScript.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/changelog.txt b/changelog.txt index 2dd97c9..d27d554 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix The Hill Times (text) * v2.6.3.0 (2022-04-03) Add Diario Cordoba diff --git a/contentScript.js b/contentScript.js index 4798239..35b1f31 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2731,6 +2731,23 @@ else if (matchDomain('hbrchina.org')) { div_hidden.removeAttribute('style'); } +else if (matchDomain('hilltimes.com')) { + let paywall = document.querySelector('div.paywallcont'); + if (paywall) { + removeDOMElement(paywall); + let json_script = getArticleJsonScript(); + if (json_script) { + let json = JSON.parse(json_script.text).filter(x => x.articleBody)[0]; + if (json) { + let json_text = json.articleBody.replace(/ /g, '').replace(/(\.|\%)\s{3,}/g, "$&\r\n\r\n"); + let content = document.querySelector('div#xorg'); + if (json_text && content) + content.innerText = '\r\n' + json_text; + } + } + } +} + else if (matchDomain('hindustantimes.com')) { let paywall = document.querySelector('.freemium-card'); if (paywall) {