Fix Groupe ESH Medias (iframely)

This commit is contained in:
magnolia1234 2024-02-13 17:22:19 +01:00
parent f78ae546b2
commit 940630b0ed
2 changed files with 14 additions and 1 deletions

View file

@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add CH Media (opt-in to custom sites for unlisted)
Fix Groupe ESH Medias (iframely)
Fix Kurier.at (js & css)
Fix Nw.de (amp-redirect)
Fix TheTimes.co.uk (mobile images)

View file

@ -665,7 +665,17 @@ else if (matchDomain(['arcinfo.ch', 'lacote.ch', 'lenouvelliste.ch'])) {// Group
if (content) {
content = content.replace(/\\u003C/g, '<').replace(/\\u003E/g, '>').replace(/\\u002F/g, '/').replace(/\\"/g, '"').replace(/\\r\\n/g, '');
let parser = new DOMParser();
let content_new = parser.parseFromString('<div class="html-content">' + DOMPurify.sanitize(content) + '</div>', 'text/html');
let content_new = parser.parseFromString('<div class="html-content">' + DOMPurify.sanitize(content, dompurify_options) + '</div>', 'text/html');
let iframely = content_new.querySelectorAll('div > div.fr-iframely');
for (let elem of iframely) {
let url_dom = elem.querySelector('[data-iframely-url]');
if (url_dom) {
let iframe = document.createElement('iframe');
iframe.src = url_dom.getAttribute('data-iframely-url');
iframe.style = 'width: 100%; height: 400px;';
elem.parentNode.replaceChild(iframe, elem);
}
}
let article_top;
if (!no_intro) {
article_top = article.parentNode.parentNode;
@ -678,6 +688,8 @@ else if (matchDomain(['arcinfo.ch', 'lacote.ch', 'lenouvelliste.ch'])) {// Group
}
}
}
let ads = document.querySelectorAll('div[class*="ads_type_"]');
hideDOMElement(...ads);
}
else if (matchDomain('augsburger-allgemeine.de')) {