mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-09-20 05:43:41 +02:00
Fix Business Standard
This commit is contained in:
parent
92adeb72f0
commit
c0ccdac903
3 changed files with 29 additions and 31 deletions
|
@ -2,6 +2,7 @@
|
||||||
Changelog Bypass Paywalls Clean - Firefox
|
Changelog Bypass Paywalls Clean - Firefox
|
||||||
|
|
||||||
Post-release
|
Post-release
|
||||||
|
Fix Business Standard
|
||||||
Fix Financial Times (amp)
|
Fix Financial Times (amp)
|
||||||
|
|
||||||
* v2.4.0.0 (2021-10-17)
|
* v2.4.0.0 (2021-10-17)
|
||||||
|
|
|
@ -1724,40 +1724,37 @@ else if (matchDomain('bostonglobe.com')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('business-standard.com')) {
|
else if (matchDomain('business-standard.com')) {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
let skip_button = document.querySelector('a.btn_skip');
|
||||||
let skip_button = document.querySelector('a.btn_skip');
|
if (skip_button)
|
||||||
if (skip_button)
|
skip_button.click();
|
||||||
skip_button.click();
|
let p_content = document.querySelector('span.p-content.paywall');
|
||||||
let paywall = document.querySelector('div.sbc_panel');
|
if (p_content) {
|
||||||
if (paywall) {
|
p_content.classList.remove('paywall');
|
||||||
removeDOMElement(paywall.parentElement);
|
let scripts = document.querySelectorAll('script[type="application/ld+json"]');
|
||||||
let scripts = document.querySelectorAll('script[type="application/ld+json"]');
|
let json;
|
||||||
let json;
|
for (let script of scripts) {
|
||||||
for (let script of scripts) {
|
if (script.innerText.includes('articleBody'))
|
||||||
if (script.innerText.includes('articleBody'))
|
json = script;
|
||||||
json = script;
|
}
|
||||||
}
|
if (json) {
|
||||||
if (json) {
|
let json_text = JSON.parse(json.text.replace(/(\r|\n|\t)/gm, ''))[0].articleBody;
|
||||||
let json_text = JSON.parse(json.text.replace(/(\r|\n|\t)/gm, ''))[0].articleBody;
|
json_text = parseHtmlEntities(json_text);
|
||||||
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';
|
||||||
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');
|
||||||
let article = document.createElement('div');
|
article.innerText = json_text;
|
||||||
article.innerText = json_text;
|
if (article) {
|
||||||
if (article) {
|
let old_pars = p_content.querySelectorAll('p');
|
||||||
let p_content = document.querySelector('span.p-content.paywall');
|
for (let old_par of old_pars) {
|
||||||
if (p_content) {
|
if (!old_par.querySelector('img'))
|
||||||
let old_pars = p_content.querySelectorAll('p');
|
removeDOMElement(old_par);
|
||||||
for (let old_par of old_pars) {
|
|
||||||
if (!old_par.querySelector('img'))
|
|
||||||
removeDOMElement(old_par);
|
|
||||||
}
|
|
||||||
p_content.appendChild(article);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
p_content.appendChild(article);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else if (matchDomain('businessoffashion.com')) {
|
else if (matchDomain('businessoffashion.com')) {
|
||||||
let paywall = document.querySelector('div.paywall');
|
let paywall = document.querySelector('div.paywall');
|
||||||
|
|
|
@ -556,5 +556,5 @@
|
||||||
"*://*.wallkit.net/*",
|
"*://*.wallkit.net/*",
|
||||||
"*://*.wsj.net/*"
|
"*://*.wsj.net/*"
|
||||||
],
|
],
|
||||||
"version": "2.4.0.0"
|
"version": "2.4.0.1"
|
||||||
}
|
}
|
Loading…
Reference in a new issue