Fix Business Standard

master
magnolia1234 2021-10-18 21:04:03 +02:00
parent 4b9a971e6f
commit 833c0715ba
4 changed files with 30 additions and 32 deletions

View File

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Chrome
Post-release
Fix Business Standard
Fix Financial Times (amp)
* v2.4.0.0 (2021-10-17)

View File

@ -1724,40 +1724,37 @@ else if (matchDomain('bostonglobe.com')) {
}
else if (matchDomain('business-standard.com')) {
document.addEventListener('DOMContentLoaded', () => {
let skip_button = document.querySelector('a.btn_skip');
if (skip_button)
skip_button.click();
let paywall = document.querySelector('div.sbc_panel');
if (paywall) {
removeDOMElement(paywall.parentElement);
let scripts = document.querySelectorAll('script[type="application/ld+json"]');
let json;
for (let script of scripts) {
if (script.innerText.includes('articleBody'))
json = script;
}
if (json) {
let json_text = JSON.parse(json.text.replace(/(\r|\n|\t)/gm, ''))[0].articleBody;
json_text = parseHtmlEntities(json_text);
json_text = json_text.replace(/(?:^|[\w\"\'\])(\.|\?|!)(?=[A-Z\"\”\“\\\'][A-Za-zÀ-ÿ\"\”\“\\\']{1,})/gm, "$&\r\n\r\n") + '\r\n\r\n';
let article = document.createElement('div');
article.innerText = json_text;
if (article) {
let p_content = document.querySelector('span.p-content.paywall');
if (p_content) {
let old_pars = p_content.querySelectorAll('p');
for (let old_par of old_pars) {
if (!old_par.querySelector('img'))
removeDOMElement(old_par);
}
p_content.appendChild(article);
}
let skip_button = document.querySelector('a.btn_skip');
if (skip_button)
skip_button.click();
let p_content = document.querySelector('span.p-content.paywall');
if (p_content) {
p_content.classList.remove('paywall');
let scripts = document.querySelectorAll('script[type="application/ld+json"]');
let json;
for (let script of scripts) {
if (script.innerText.includes('articleBody'))
json = script;
}
if (json) {
let json_text = JSON.parse(json.text.replace(/(\r|\n|\t)/gm, ''))[0].articleBody;
json_text = parseHtmlEntities(json_text);
json_text = json_text.replace(/(?:^|[\w\"\'\])(\.|\?|!)(?=[A-Z\"\”\“\\\'][A-Za-zÀ-ÿ\"\”\“\\\']{1,})/gm, "$&\r\n\r\n") + '\r\n\r\n';
let article = document.createElement('div');
article.innerText = json_text;
if (article) {
let old_pars = p_content.querySelectorAll('p');
for (let old_par of old_pars) {
if (!old_par.querySelector('img'))
removeDOMElement(old_par);
}
p_content.appendChild(article);
}
}
});
}
}
else if (matchDomain('businessoffashion.com')) {
let paywall = document.querySelector('div.paywall');

View File

@ -39,5 +39,5 @@
"webRequestBlocking",
"<all_urls>"
],
"version": "2.4.0.0"
"version": "2.4.0.1"
}

View File

@ -544,5 +544,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.4.0.0"
"version": "2.4.0.1"
}