|
|
@ -1928,113 +1928,25 @@ else if (matchDomain('ftm.nl')) {
|
|
|
|
removeDOMElement(banner_pp);
|
|
|
|
removeDOMElement(banner_pp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else if (matchDomain(['gva.be', 'hbvl.be', 'nieuwsblad.be'])) {
|
|
|
|
else if (matchDomain(['gva.be', 'hbvl.be', 'nieuwsblad.be', 'standaard.be'])) {
|
|
|
|
|
|
|
|
let url = window.location.href;
|
|
|
|
|
|
|
|
let article_selector = 'div[data-mht-block="article-detail__article-main"]';
|
|
|
|
|
|
|
|
if (matchDomain('standaard.be'))
|
|
|
|
|
|
|
|
article_selector = 'article';
|
|
|
|
let paywall = document.querySelector('div[data-cj-root="subscription-wall"]');
|
|
|
|
let paywall = document.querySelector('div[data-cj-root="subscription-wall"]');
|
|
|
|
if (paywall && dompurify_loaded) {
|
|
|
|
if (paywall) {
|
|
|
|
removeDOMElement(paywall);
|
|
|
|
removeDOMElement(paywall);
|
|
|
|
let main_content = document.querySelector('div[data-mht-block="article-detail__article-main"]');
|
|
|
|
csDoneOnce = true;
|
|
|
|
let json_script = main_content.querySelector('script');
|
|
|
|
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0];
|
|
|
|
let json_str = json_script.text.substring(json_script.textContent.indexOf('{'));
|
|
|
|
replaceDomElementExt(url_cache, true, false, article_selector);
|
|
|
|
try {
|
|
|
|
window.setTimeout(function () {
|
|
|
|
let json = JSON.parse(json_str);
|
|
|
|
let overlay = document.querySelector('div.cj-root');
|
|
|
|
if (json) {
|
|
|
|
removeDOMElement(overlay);
|
|
|
|
let json_text = Object.values(json)[0]['data']['article']['body'];
|
|
|
|
let noscroll = document.querySelector('html.is-dialog-active');
|
|
|
|
let parser = new DOMParser();
|
|
|
|
if (noscroll)
|
|
|
|
let div_content = main_content.querySelector('div');
|
|
|
|
noscroll.classList.remove('is-dialog-active');
|
|
|
|
let par_elem, par_key, par_li, par_html, par_link;
|
|
|
|
}, 1000); // Delay (in milliseconds)
|
|
|
|
let head = document.querySelector('head');
|
|
|
|
|
|
|
|
let streamone = false;
|
|
|
|
|
|
|
|
let flourish = false;
|
|
|
|
|
|
|
|
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>' + DOMPurify.sanitize(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>' + DOMPurify.sanitize(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 === 'related') {
|
|
|
|
|
|
|
|
par_elem = document.createElement('p');
|
|
|
|
|
|
|
|
if (par_key.article && par_key.article.title && par_key.article.webcmsRelativeUrl) {
|
|
|
|
|
|
|
|
par_link = document.createElement('a');
|
|
|
|
|
|
|
|
if (par_key.article.label)
|
|
|
|
|
|
|
|
par_link.innerText = par_key.article.label;
|
|
|
|
|
|
|
|
par_link.innerText += par_key.article.title;
|
|
|
|
|
|
|
|
par_link.href = par_key.article.webcmsRelativeUrl;
|
|
|
|
|
|
|
|
par_elem.appendChild(par_link);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (key === 'iframe_sized') {
|
|
|
|
|
|
|
|
par_elem = document.createElement('iframe');
|
|
|
|
|
|
|
|
par_elem.src = par_key.url;
|
|
|
|
|
|
|
|
if (par_key.height && par_key.width) {
|
|
|
|
|
|
|
|
par_elem.setAttribute('height', par_key.height);
|
|
|
|
|
|
|
|
par_elem.setAttribute('width', par_key.width);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (key === 'streamone') {
|
|
|
|
|
|
|
|
if (!streamone) {
|
|
|
|
|
|
|
|
let streamone_script = document.createElement('script');
|
|
|
|
|
|
|
|
streamone_script.setAttribute('src', 'https://shared.mediahuis.be/videoplayers/mediahuis/video-theoplayer.js?v=20220525T184101');
|
|
|
|
|
|
|
|
streamone_script.setAttribute('defer', true);
|
|
|
|
|
|
|
|
streamone_script.setAttribute('crossorigin', 'anonymous');
|
|
|
|
|
|
|
|
if (head)
|
|
|
|
|
|
|
|
head.appendChild(streamone_script);
|
|
|
|
|
|
|
|
streamone = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let par_key_id = DOMPurify.sanitize(par_key.id);
|
|
|
|
|
|
|
|
par_html = parser.parseFromString('<div id="json_id"><div><div><div><div data-testid="embed-video"><div><div id="video-player-' + par_key_id + '" style="width:100%;" data-video-embed-id="' + par_key_id + '" data-video-target-id="video-player-' + par_key_id + '" data-video-brand="gva" class="js-theoplayer-placeholder"></div></div></div></div></div>', 'text/html');
|
|
|
|
|
|
|
|
par_elem = par_html.querySelector('div');
|
|
|
|
|
|
|
|
} else if (key === 'legacy-ml') {
|
|
|
|
|
|
|
|
par_html = parser.parseFromString('<div>' + DOMPurify.sanitize(par_key) + '</div>', 'text/html');
|
|
|
|
|
|
|
|
par_elem = par_html.querySelector('div');
|
|
|
|
|
|
|
|
if (!flourish && par_key.includes('flourish.studio')) {
|
|
|
|
|
|
|
|
let flourish_script = document.createElement('script');
|
|
|
|
|
|
|
|
flourish_script.setAttribute('src', 'https://public.flourish.studio/resources/embed.js');
|
|
|
|
|
|
|
|
if (head)
|
|
|
|
|
|
|
|
head.appendChild(flourish_script);
|
|
|
|
|
|
|
|
flourish = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log(key);
|
|
|
|
|
|
|
|
console.log(par_key);
|
|
|
|
|
|
|
|
par_html = parser.parseFromString('<p>' + DOMPurify.sanitize(par_key) + '</p>', 'text/html');
|
|
|
|
|
|
|
|
par_elem = par_html.querySelector('p');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!['streamone', 'legacy-ml', 'iframe_sized'].includes(key))
|
|
|
|
|
|
|
|
par_elem.setAttribute('style', 'font-size: 16px;');
|
|
|
|
|
|
|
|
if (par_elem)
|
|
|
|
|
|
|
|
div_content.appendChild(par_elem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
console.warn('unable to parse text');
|
|
|
|
|
|
|
|
console.warn(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else if (matchDomain(['knack.be', 'kw.be', 'levif.be'])) {
|
|
|
|
else if (matchDomain(['knack.be', 'kw.be', 'levif.be'])) {
|
|
|
@ -2070,6 +1982,8 @@ else if (matchDomain('limburger.nl')) {
|
|
|
|
let noscroll = document.querySelector('html.is-dialog-active');
|
|
|
|
let noscroll = document.querySelector('html.is-dialog-active');
|
|
|
|
if (noscroll)
|
|
|
|
if (noscroll)
|
|
|
|
noscroll.classList.remove('is-dialog-active');
|
|
|
|
noscroll.classList.remove('is-dialog-active');
|
|
|
|
|
|
|
|
let ads = document.querySelectorAll('div.ad');
|
|
|
|
|
|
|
|
removeDOMElement(...ads);
|
|
|
|
}, 1000); // Delay (in milliseconds)
|
|
|
|
}, 1000); // Delay (in milliseconds)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|