mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 07:07:47 +01:00
Fix Telegraaf.nl
This commit is contained in:
parent
6f3679dcdf
commit
84aa5aa881
1 changed files with 33 additions and 5 deletions
|
@ -54,12 +54,40 @@ else if (matchDomain("americanbanker.com")) {
|
|||
}
|
||||
|
||||
else if (matchDomain('telegraaf.nl')) {
|
||||
setTimeout(function () {
|
||||
const paywall = document.getElementById('TEMPRORARY_METERING_ID');
|
||||
if (paywall) {
|
||||
window.location.reload(true);
|
||||
if (window.location.href.startsWith('https://www.telegraaf.nl/error?ref=/')) {
|
||||
window.location.href = window.location.href.split('&')[0].replace('error?ref=/', '');
|
||||
}
|
||||
let article_wrapper = document.querySelector('.ArticlePageWrapper__uid');
|
||||
let spotx_banner = document.querySelector('.ArticleBodyBlocks__inlineArticleSpotXBanner');
|
||||
let paywall = document.querySelector('.PopupBackdrop__block');
|
||||
removeDOMElement(spotx_banner, paywall);
|
||||
let premium = document.querySelector('.PremiumLabelWithLine__body');
|
||||
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"]');
|
||||
if (json) {
|
||||
json_text = JSON.parse(json.text).articleBody;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000); // Delay (in milliseconds)
|
||||
}
|
||||
|
||||
else if (matchDomain('ad.nl')) {
|
||||
|
|
Loading…
Reference in a new issue