From 940630b0ed7f8c5cec65ba5886cb90a81cbeebdc Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 13 Feb 2024 17:22:19 +0100 Subject: [PATCH] Fix Groupe ESH Medias (iframely) --- changelog.txt | 1 + contentScript.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 14b64b96..eac22245 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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) diff --git a/contentScript.js b/contentScript.js index 31966771..ec574cb4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -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('
' + DOMPurify.sanitize(content) + '
', 'text/html'); + let content_new = parser.parseFromString('
' + DOMPurify.sanitize(content, dompurify_options) + '
', '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')) {