Fix Foreign Policy (Insider)

This commit is contained in:
magnolia1234 2023-12-23 10:15:44 +01:00
parent aecf619e49
commit a7d6660737
3 changed files with 7 additions and 20 deletions

View file

@ -12,6 +12,7 @@ Remove Bnn.de (fix obsolete)
Remove LeTemps.ch (fix obsolete) Remove LeTemps.ch (fix obsolete)
Remove Money.it (fix obsolete) Remove Money.it (fix obsolete)
Fix Automobilwoche.de (js) Fix Automobilwoche.de (js)
Fix Foreign Policy (Insider)
Fix Groupe Centre France (identify sites) Fix Groupe Centre France (identify sites)
Fix Harvard Business Review (script) Fix Harvard Business Review (script)
Fix LeParisien.fr (amp-redirect) Fix LeParisien.fr (amp-redirect)

View file

@ -3967,25 +3967,11 @@ else if (matchDomain('foreignpolicy.com')) {
removeDOMElement(content_ungated); removeDOMElement(content_ungated);
let content_gated = document.querySelector('div.content-gated'); let content_gated = document.querySelector('div.content-gated');
if (content_gated) { if (content_gated) {
content_gated.classList.remove('content-gated');
let insider = document.querySelector('body.is-fp-insider'); let insider = document.querySelector('body.is-fp-insider');
if (insider) { if (insider)
window.setTimeout(function () { getJsonUrl('div.content-gated', {rm_class: 'content-gated'}, 'div.content-gated');
let json_script = getArticleJsonScript(); else
if (json_script) { content_gated.classList.remove('content-gated');
let json = JSON.parse(json_script.text);
if (json) {
let content = json.Articlebody.replace(/\r\n/g, '<br>');
if (content) {
let parser = new DOMParser();
let doc = parser.parseFromString('<div style="margin: 50px;">' + DOMPurify.sanitize(content) + '</div>', 'text/html');
let content_new = doc.querySelector('div');
content_gated.before(content_new);
}
}
}
}, 500);
}
} }
} }
} }

View file

@ -106,12 +106,12 @@
"domain": "###_usa_townnews", "domain": "###_usa_townnews",
"block_regex_general": "\\/tncms\\/api\\/access(\\..+)?\\.js", "block_regex_general": "\\/tncms\\/api\\/access(\\..+)?\\.js",
"cs_dompurify": 1, "cs_dompurify": 1,
"upd_version": "3.4.1.6", "upd_version": "3.4.1.6"
},
"Weser-Kurier": { "Weser-Kurier": {
"domain": "weser-kurier.de", "domain": "weser-kurier.de",
"allow_cookies": 1, "allow_cookies": 1,
"block_regex": "\\.piano\\.io\\/", "block_regex": "\\.piano\\.io\\/",
"upd_version": "3.4.6.4" "upd_version": "3.4.6.4"
} }
}
} }