Fix Telegraaf.nl

merge-requests/2/head
magnolia1234 3 years ago
parent 6d1a8ddce9
commit cc0d234f3d

@ -316,6 +316,7 @@ var blockedRegexes = {
'hilltimes.com': /\.hilltimes\.com\/.+\/js\/loadingoverlay\/loadingoverlay\.min\.js/,
'historyextra.com': /\.evolok\.net\/.+\/authorize\//,
'houstonchronicle.com': /\.blueconic\.net\//,
'inc.com': /\.tinypass\.com\//,
'independent.ie': /(cdn\.flip-pay\.com\/clients\/inm\/flip-pay\.js|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js)/,
'inquirer.com': /\.tinypass\.com\//,
'irishtimes.com': /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/,

@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix Bloomberg (blurred images)
Fix Telegraaf.nl
* v2.3.1.0 (2021-08-01)
Add Iltalehti.fi (Firefox-only)

@ -1380,35 +1380,41 @@ else if (matchDomain('telegraaf.nl')) {
}
let article_wrapper = document.querySelector('.ArticlePageWrapper__uid');
let spotx_banner = document.querySelector('.ArticleBodyBlocks__inlineArticleSpotXBanner');
let paywall = document.querySelector('.PopupBackdrop__block');
let paywall = document.querySelector('.MeteringNotification__backdrop');
removeDOMElement(spotx_banner, paywall);
let premium = document.querySelector('.PremiumLabelWithLine__body');
let premium = document.querySelector('.PremiumLabelWithLine');
let article_id = article_wrapper ? article_wrapper.innerText : '123';
let article_body_done = document.querySelector('#articleBody' + article_id);
if (premium && !article_body_done) {
let article_body_old = document.querySelector('[id^="articleBody"]');
removeDOMElement(article_body_old);
let json = document.querySelector('script[type="application/ld+json"][data-react-helmet="true"]');
let html = document.documentElement.outerHTML;
let json = html.split('window.__APOLLO_STATE__=')[1].split('};')[0] + '}';
if (json) {
let json_text = JSON.parse(json.text).articleBody;
let intro = document.querySelector('span[id^="articleIntro"]');
if (intro)
json_text = json_text.replace(intro.innerText + '\n\n', '');
let article_body = document.querySelector('section.TextArticlePage__bodyText');
if (article_body) {
let div_main = document.createElement('div');
div_main.setAttribute('id', 'articleBody' + article_id);
let div_elem = document.createElement('div');
div_elem.setAttribute('data-element', 'articleBodyBlocks');
let text_array = json_text.split('\n\n');
text_array.forEach(p_text => {
let p_div = document.createElement('p');
p_div.setAttribute('class', 'ArticleBodyBlocks__paragraph ArticleBodyBlocks__paragraph--nieuws');
p_div.innerText = p_text;
div_elem.appendChild(p_div);
});
div_main.appendChild(div_elem);
article_body.appendChild(div_main);
let json_article_id = json.split('uid\":')[1].split(',\"')[0];
if (json_article_id && json_article_id !== article_id)
window.location.reload(true);
let json_text = json.split('"body":"')[1].split('","__typename":')[0];
if (json_text) {
let intro = document.querySelector('span[id^="articleIntro"]');
if (intro)
json_text = json_text.replace(intro.innerText + '\n\n', '');
let article_body = document.querySelector('section.TextArticlePage__bodyText');
if (article_body) {
let div_main = document.createElement('div');
div_main.setAttribute('id', 'articleBody' + article_id);
let div_elem = document.createElement('div');
div_elem.setAttribute('data-element', 'articleBodyBlocks');
let text_array = json_text.split('\\n');
text_array.forEach(p_text => {
let p_div = document.createElement('p');
p_div.setAttribute('class', 'ArticleBodyBlocks__paragraph');
p_div.innerText = p_text;
div_elem.appendChild(p_div);
});
div_main.appendChild(div_elem);
article_body.appendChild(div_main);
}
}
}
}

@ -540,5 +540,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.3.1.1"
"version": "2.3.1.2"
}
Loading…
Cancel
Save