Add Gazet van Antwerpen (Belgium)
This commit is contained in:
parent
9141c435ba
commit
c12cde21d7
@ -241,6 +241,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
|
||||
[De Tijd](https://www.tijd.be) -
|
||||
[Financieele Dagblad](https://fd.nl) -
|
||||
[Follow the Money](https://www.ftm.nl) -
|
||||
[Gazet van Antwerpen](https://www.gva.be) -
|
||||
[Groene Amsterdammer](https://www.groene.nl) -
|
||||
[Humo.be](https://www.humo.be) -
|
||||
[Knack.be](https://www.knack.be) -
|
||||
|
@ -46,6 +46,7 @@ var allow_cookies = [
|
||||
'ftm.nl',
|
||||
'gelocal.it',
|
||||
'gestion.pe',
|
||||
'gva.be',
|
||||
'haaretz.co.il',
|
||||
'haaretz.com',
|
||||
'handelsblatt.com',
|
||||
|
@ -2,6 +2,7 @@
|
||||
Changelog Bypass Paywalls Clean - Chrome
|
||||
|
||||
Post-release
|
||||
Add Gazet van Antwerpen (Belgium)
|
||||
Fix-update Australian Provincial Newspapers
|
||||
Fix-update Haaretz/TheMarker (Bingbot)
|
||||
Fix-update Telegraph.co.uk (overlay)
|
||||
|
@ -814,7 +814,7 @@ else if (matchDomain('faz.net')) {
|
||||
str = str.replace(/(?:^|[\w\"\“])(\.|\?|!)(?=[A-ZÖÜ\„][A-Za-zÀ-ÿ\„]{1,})/gm, "$&\n\n");
|
||||
str = str.replace(/([a-z\"\“])(?=[A-Z](?=[A-Za-zÀ-ÿ]+))/gm, "$&\n\n");
|
||||
// exceptions: names with alternating lower/uppercase (no general fix)
|
||||
let str_rep_arr = ["BaFin", "BerlHG", "BilMoG", "EuGH", "GlaxoSmithKline", "IfSG", "iMessage", "iOS", "iPad", "iPhone", "medRxiv", "mNRA", "StVO"];
|
||||
let str_rep_arr = ["BaFin", "BerlHG", "BfArM", "BilMoG", "EuGH", "GlaxoSmithKline", "IfSG", "iMessage", "iOS", "iPad", "iPhone", "medRxiv", "mNRA", "StVO"];
|
||||
let str_rep_split, str_rep_src;
|
||||
for (let str_rep of str_rep_arr) {
|
||||
str_rep_split = str_rep.split(/([a-z]+)(?=[A-Z](?=[A-Za-z]+))/);
|
||||
@ -1434,6 +1434,74 @@ else if (matchDomain('gelocal.it')) {
|
||||
}
|
||||
}
|
||||
|
||||
else if (matchDomain("gva.be")) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let paywall = document.querySelector('div[data-cj-root="subscription-wall"]');
|
||||
removeDOMElement(paywall);
|
||||
if (paywall) {
|
||||
let main_content = document.querySelector('div[data-mht-block="article-detail__article-main"]');
|
||||
let json_script = main_content.querySelector('script');
|
||||
let json_str = json_script.text.substring(json_script.textContent.indexOf('{'));
|
||||
let json = JSON.parse(json_str);
|
||||
let premium = Object.values(json)[0]['premium'];
|
||||
if (json) {
|
||||
let json_text = Object.values(json)[0]['body']['json'];
|
||||
let parser = new DOMParser();
|
||||
let div_content = main_content.querySelector('div');
|
||||
div_content.setAttribute('class', 'gva-6c6ea21_marginbottom5 gva-28c280e9_contentwrapper');
|
||||
let par_elem, par_key, par_li, par_html;
|
||||
for (let par of json_text) {
|
||||
for (let key in par) {
|
||||
par_elem = document.createElement('p');
|
||||
par_key = par[key];
|
||||
if (['p', 'subhead'].includes(key)) {
|
||||
if (par_key.includes('<')) {
|
||||
par_html = parser.parseFromString('<p>' + par_key + '</p>', 'text/html');
|
||||
par_elem = par_html.querySelector('p');
|
||||
} else
|
||||
par_elem.innerText = par_key;
|
||||
if (key === 'subhead')
|
||||
par_elem.setAttribute('style', 'font-weight: bold;');
|
||||
} else if (key === 'image') {
|
||||
par_elem = document.createElement("img");
|
||||
par_elem.src = par_key.url;
|
||||
} else if (key === 'bullet_list') {
|
||||
par_elem = document.createElement('ul');
|
||||
for (let bullet of par_key) {
|
||||
par_html = parser.parseFromString('<li>' + bullet + '</li>', 'text/html');
|
||||
par_li = par_html.querySelector('li');
|
||||
let bullet_link = par_li.querySelector('a');
|
||||
if (bullet_link && bullet_link.href && !bullet_link.innerText)
|
||||
bullet_link.innerText = bullet_link.href;
|
||||
par_elem.appendChild(par_li);
|
||||
}
|
||||
} else if (key === 'streamone') {
|
||||
false;
|
||||
} else if (key === 'legacy-ml') {
|
||||
par_html = parser.parseFromString(par_key, 'text/html');
|
||||
par_elem = par_html.querySelector('div');
|
||||
} else {
|
||||
console.log(key + ': ' + par_key);
|
||||
par_html = parser.parseFromString('<p>' + par_key + '</p>', 'text/html');
|
||||
par_elem = par_html.querySelector('p');
|
||||
}
|
||||
if (!['streamone', 'legacy-ml'].includes(key))
|
||||
par_elem.setAttribute('class', 'gva-3ee037ad_root gva-3ee037ad_paragraph gva-68d24f7d_none gva-ef7ba41a_system gva-6c6ea21_marginbottom5 gva-6c6ea21_margintop0 gva-21a3e72f_inherit');
|
||||
div_content.appendChild(par_elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
window.setTimeout(function () {
|
||||
let overlay = document.querySelector('div.cj-root');
|
||||
removeDOMElement(overlay);
|
||||
let noscroll = document.querySelector('html.is-dialog-active');
|
||||
if (noscroll)
|
||||
noscroll.classList.remove('is-dialog-active');
|
||||
}, 500); // Delay (in milliseconds)
|
||||
}
|
||||
|
||||
// General Functions
|
||||
function removeDOMElement(...elements) {
|
||||
for (let element of elements) {
|
||||
|
@ -112,6 +112,7 @@
|
||||
"*://*.goldcoastbulletin.com.au/*",
|
||||
"*://*.groene.nl/*",
|
||||
"*://*.grubstreet.com/*",
|
||||
"*://*.gva.be/*",
|
||||
"*://*.gympietimes.com.au/*",
|
||||
"*://*.haaretz.co.il/*",
|
||||
"*://*.haaretz.com/*",
|
||||
@ -326,5 +327,5 @@
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
"version": "1.9.3.5"
|
||||
"version": "1.9.3.6"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user