|
|
|
@ -2743,7 +2743,7 @@ else if (matchDomain('telegraaf.nl')) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
article.after(div_main);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let banners = document.querySelectorAll('.ArticleBodyBlocks__inlineArticleSpotXBanner, .WebpushOptin');
|
|
|
|
|
removeDOMElement(...banners);
|
|
|
|
|
}
|
|
|
|
@ -5736,6 +5736,79 @@ else if (matchDomain(no_nhst_media_domains)) {
|
|
|
|
|
let blurred = document.querySelector('body > div[style]');
|
|
|
|
|
if (blurred)
|
|
|
|
|
blurred.removeAttribute('style');
|
|
|
|
|
} else if (matchDomain('upstreamonline.com')) {
|
|
|
|
|
window.setTimeout(function () {
|
|
|
|
|
let paywall = document.querySelector('div.dn-paywall > div#sub-paywall-container');
|
|
|
|
|
if (paywall && dompurify_loaded) {
|
|
|
|
|
removeDOMElement(paywall.parentNode);
|
|
|
|
|
let article = document.querySelector('div#dn-content');
|
|
|
|
|
let json_script = document.querySelector('script#__NUXT_DATA__');
|
|
|
|
|
if (json_script) {
|
|
|
|
|
try {
|
|
|
|
|
let pars = JSON.parse(json_script.text);
|
|
|
|
|
let article_id_index = pars.indexOf('global-article') + 1;
|
|
|
|
|
if (article_id_index) {
|
|
|
|
|
let article_id = pars[article_id_index];
|
|
|
|
|
if (article_id && !window.location.pathname.endsWith(article_id)) {
|
|
|
|
|
refreshCurrentTab();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
article.innerHTML = '';
|
|
|
|
|
article.classList.remove('shadow');
|
|
|
|
|
let img_first = true;
|
|
|
|
|
let parser = new DOMParser();
|
|
|
|
|
for (let par of pars) {
|
|
|
|
|
let elem;
|
|
|
|
|
if (par.type) {
|
|
|
|
|
let type = pars[par.type];
|
|
|
|
|
if (['text', 'subhead'].includes(type)) {
|
|
|
|
|
if (par.html || par.value) {
|
|
|
|
|
let index = par.html || par.value;
|
|
|
|
|
let json_text = pars[index];
|
|
|
|
|
let content_new = parser.parseFromString('<p class="dn-text">' + DOMPurify.sanitize(json_text) + '</p>', 'text/html');
|
|
|
|
|
elem = content_new.querySelector('p');
|
|
|
|
|
if (par.value)
|
|
|
|
|
elem.style = 'font-weight: bold;';
|
|
|
|
|
}
|
|
|
|
|
} else if (type === 'picture') {
|
|
|
|
|
if (img_first)
|
|
|
|
|
img_first = false;
|
|
|
|
|
else {
|
|
|
|
|
elem = document.createElement('figure');
|
|
|
|
|
elem.className = 'dn-image';
|
|
|
|
|
let img = document.createElement('img');
|
|
|
|
|
img.src = pars[par.src];
|
|
|
|
|
elem.appendChild(img);
|
|
|
|
|
if (par.caption) {
|
|
|
|
|
let caption = document.createElement('p');
|
|
|
|
|
caption.innerText = pars[par.caption];
|
|
|
|
|
if (par.credit)
|
|
|
|
|
caption.innerText += ' (' + pars[par.credit] + ')';
|
|
|
|
|
elem.appendChild(caption);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (type === 'news' && par.title && par.url) {
|
|
|
|
|
elem = document.createElement('a');
|
|
|
|
|
elem.href = pars[par.url];
|
|
|
|
|
elem.innerText = 'Related: ' + pars[par.title];
|
|
|
|
|
elem.style = 'font-weight: bold;';
|
|
|
|
|
} else if (!['ad', 'author', 'break', 'Location', 'news', 'Organisation', 'promobox', 'Person', 'Region', 'Regions', 'related', 'Sectors'].includes(type)) {
|
|
|
|
|
for (let item in par) {
|
|
|
|
|
console.log(item);
|
|
|
|
|
console.log(pars[par[item]]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (elem)
|
|
|
|
|
article.appendChild(elem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.log(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
} else {
|
|
|
|
|
let fade = document.querySelector('div[style*="background-image: linear-gradient"]');
|
|
|
|
|
if (fade) {
|
|
|
|
|