From af6e944887e2b066fc377922112a0d2fe5c65c1e Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 12 Apr 2024 13:00:42 +0200 Subject: [PATCH] Fix Business-standard.com --- changelog.txt | 3 ++- contentScript.js | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index f21e035..67c040e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,8 +5,9 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add OVB Media (opt-in to custom sites for unlisted) Add Private Media AU -Fix Business Insider (js) Fix BizJournals (css) +Fix Business Insider (js) +Fix Business-standard.com Fix The Economist (regwall) Fix WaPo (js) Update custom sites (block_regex_ignore_default) diff --git a/contentScript.js b/contentScript.js index 114fd05..dfba529 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3963,14 +3963,17 @@ else if (matchDomain('business-standard.com')) { let json = JSON.parse(json_script.text); if (json && json.props.pageProps.data.htmlContent) { let json_text = json.props.pageProps.data.htmlContent; - let content = document.querySelector('div.storycontent'); + let content = document.querySelector('div[class^="MainStory_storycontent__"'); if (json_text && content) { + content.innerHTML = ''; let intro = content.querySelectorAll('div:not([class]'); removeDOMElement(...intro); let parser = new DOMParser(); - let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html'); + let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text, dompurify_options) + '
', 'text/html'); let content_new = doc.querySelector('div'); - content.firstChild.before(content_new); + window.setTimeout(function () { + content.appendChild(content_new); + }, 1000); } } else refreshCurrentTab();