Add Business Standard (India)
parent
d14ea86441
commit
d9f97f8c14
|
@ -264,6 +264,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
|
|||
|
||||
#### India
|
||||
[Bloomberg Quint](https://www.bloombergquint.com)* -
|
||||
[Business Standard](https://www.business-standard.com) -
|
||||
[LiveMint](https://www.livemint.com) -
|
||||
[The Hindu](https://www.thehindu.com)
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ var allow_cookies = [
|
|||
'adelaidenow.com.au',
|
||||
'aftonbladet.se',
|
||||
'bostonglobe.com',
|
||||
'business-standard.com',
|
||||
'cairnspost.com.au',
|
||||
'clarin.com',
|
||||
'couriermail.com.au',
|
||||
|
|
|
@ -799,6 +799,36 @@ else if (matchDomain("magazine.atavist.com")) {
|
|||
paywall.classList.remove('paywall-notification-visible');
|
||||
}
|
||||
|
||||
else if (matchDomain("business-standard.com")) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
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) {
|
||||
var json_text = JSON.parse(json.text.replace(/(\r\n|\n|\r|\t)/gm, ''))[0].articleBody;
|
||||
json_text = parseHtmlEntities(json_text.replace(/(?:^|[\w\"\'\’])(\.|\?|!)(?=[A-Za-zÀ-ÿ\"\”\']{2,})/gm, "$&\n\n") + '\n\n');
|
||||
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);
|
||||
}
|
||||
let new_par = document.createElement("p");
|
||||
new_par.innerText = json_text;
|
||||
p_content.appendChild(new_par);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// General Functions
|
||||
function removeDOMElement(...elements) {
|
||||
for (let element of elements) {
|
||||
|
@ -848,3 +878,9 @@ function pageContains(selector, text) {
|
|||
return RegExp(text).test(element.textContent);
|
||||
});
|
||||
}
|
||||
|
||||
function parseHtmlEntities(str) {
|
||||
var elem = document.createElement('textarea');
|
||||
elem.innerHTML = str;
|
||||
return elem.value;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"*://*.bordermail.com.au/*",
|
||||
"*://*.bostonglobe.com/*",
|
||||
"*://*.britannica.com/*",
|
||||
"*://*.business-standard.com/*",
|
||||
"*://*.businessinsider.com/*",
|
||||
"*://*.cairnspost.com.au/*",
|
||||
"*://*.caixinglobal.com/*",
|
||||
|
|
1
sites.js
1
sites.js
|
@ -14,6 +14,7 @@ var defaultSites =
|
|||
"Bloomberg": "bloomberg.com",
|
||||
"Bloomberg Quint (free articles only)": "bloombergquint.com",
|
||||
"Business Insider": "businessinsider.com",
|
||||
"Business Standard": "business-standard.com",
|
||||
"Cairns Post": "cairnspost.com.au",
|
||||
"Caixin Global": "caixinglobal.com",
|
||||
"Central Western Daily": "centralwesterndaily.com.au",
|
||||
|
|
Loading…
Reference in New Issue