Fix Humanite.fr

merge-requests/20/merge
magnolia1234 2 months ago
parent 3db6d921c7
commit 759af025dc

@ -6,6 +6,7 @@ Post-release
Add American Purpose
Add Ringier Axel Springer Polska
Remove Hbvl.be (fix obsolete)
Fix Humanite.fr
Fix LeMonde.fr (bug; update rules)
Fix WSJ (intro video)
Update custom sites (search)

@ -1944,28 +1944,10 @@ else if (matchDomain(fr_groupe_nice_matin_domains)) {
else if (matchDomain('humanite.fr')) {
let paywall = document.querySelector('div.single__categories svg');
if (paywall && dompurify_loaded) {
let json_script = document.querySelector('script[id="module-sage-index.js-js-extra"]');
if (json_script) {
csDoneOnce = true;
if (json_script.text.match(/js_vars\s?=\s?/)) {
try {
let json = JSON.parse(json_script.text.split(/js_vars\s?=\s?/)[1].split('};')[0] + '}');
let json_text = json.post.post_content.split('<!-- /wp:huma/featured-media -->')[1];
let article = document.querySelector('div.rich-text > div.gs-row');
if (article) {
let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + DOMPurify.sanitize(json_text, dompurify_options) + '</div>', 'text/html');
let article_new = doc.querySelector('div');
if (article_new) {
article.innerHTML = '';
article.appendChild(article_new);
}
}
} catch (err) {
console.log(err);
}
}
}
csDoneOnce = true;
let url = window.location.href;
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split(/[#\?]/)[0];
replaceDomElementExt(url_cache, true, false, 'div.rich-text > div.gs-row');
}
}

@ -71,6 +71,13 @@
"nofix": 1,
"upd_version": "3.6.0.8"
},
"L'Humanité": {
"domain": "humanite.fr",
"allow_cookies": 1,
"block_regex": "\\.qiota\\.com",
"ld_google_webcache": "div.single__categories svg|div.rich-text > div.gs-row",
"upd_version": "3.6.1.5"
},
"Le Monde (link to archive.is)": {
"domain": "lemonde.fr",
"allow_cookies": 1,

Loading…
Cancel
Save