From 82693ce8222b35c36dc2ff20d4fee693d2589e5e Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 27 Mar 2024 08:58:00 +0100 Subject: [PATCH] Fix LeMonde.fr --- changelog.txt | 1 + contentScript.js | 20 +++++++++++++++----- custom/manifest.json | 2 +- manifest.json | 2 +- sites_updated.json | 5 ++--- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index dba08f7..43e5641 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add Ringier Axel Springer Polska Remove Hbvl.be (fix obsolete) +Fix LeMonde.fr (bug; update rules) Update custom sites (search) * v3.6.1.0 (2024-03-24) diff --git a/contentScript.js b/contentScript.js index cc48d27..aed5c5a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2045,11 +2045,21 @@ else if (matchDomain(['lejdd.fr', 'parismatch.com', 'public.fr'])) { } else if (matchDomain('lemonde.fr')) { - let url = window.location.href; - let paywall = document.querySelector('section.paywall'); + let paywall_sel = 'section.paywall'; + let paywall = document.querySelector(paywall_sel); if (paywall) { - removeDOMElement(paywall); - getArchive(url, 'article'); + let article_sel = 'article'; + let figure = document.querySelector('figure.article__media'); + if (figure) { + func_post = function () { + let figure_new = document.querySelector('article > figure'); + let article = document.querySelector(article_sel); + if (!figure_new && article) + article.firstChild.before(figure); + } + } + let url = window.location.href; + getArchive(url, paywall_sel, '', article_sel); let hide = document.querySelector('section.article__wrapper--premium'); if (hide) removeClassesByPrefix(hide, 'article__content--restricted'); @@ -5518,7 +5528,7 @@ else if (matchDomain('theglobeandmail.com')) { else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) { if (!window.location.pathname.endsWith('/amp/')) { let counter = document.querySelector('#test'); - let ads = document.querySelectorAll('div.article-ad, div.dfp-ad, div#paywallbox'); + let ads = document.querySelectorAll('div.article-ad, div.dfp-ad, div#paywallbox, div[id^="piano-art-"]'); hideDOMElement(counter, ...ads); } else { let ads = document.querySelectorAll('amp-ad, amp-embed, [class^="height"], [class^="advt"], [id^="piano"]'); diff --git a/custom/manifest.json b/custom/manifest.json index 67333b6..5d49f4d 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.6.1.2" + "version": "3.6.1.3" } diff --git a/manifest.json b/manifest.json index 3bec2e0..4839fcb 100644 --- a/manifest.json +++ b/manifest.json @@ -866,5 +866,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.6.1.2" + "version": "3.6.1.3" } diff --git a/sites_updated.json b/sites_updated.json index 269ad80..cd36072 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -65,13 +65,12 @@ "nofix": 1, "upd_version": "3.6.0.8" }, - "Le Monde": { + "Le Monde (link to archive.is)": { "domain": "lemonde.fr", "allow_cookies": 1, "add_ext_link": "section.paywall|article", "add_ext_link_type": "archive.is", - "ld_archive_is": "section.paywall|article", - "upd_version": "3.6.0.8" + "upd_version": "3.6.1.3" }, "LeMoniteur.fr": { "domain": "lemoniteur.fr",