Fix Foreign Policy (Insider)

merge-requests/15/head
magnolia1234 11 months ago
parent a5f8123f43
commit 3f62ad7290

@ -5,6 +5,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Groupe ESH Medias (ch)
Fix Beobachter.ch & Handelszeitung.ch
Fix Foreign Policy (Insider)
* v3.2.2.0 (2023-06-25)
Add Follow the Money (Ftm.eu)

@ -3554,10 +3554,31 @@ else if (matchDomain('foreignaffairs.com')) {
else if (matchDomain('foreignpolicy.com')) {
let content_ungated = document.querySelector('div.content-ungated');
removeDOMElement(content_ungated);
let content_gated = document.querySelector('div.content-gated');
if (content_gated)
content_gated.classList.remove('content-gated');
if (content_ungated && dompurify_loaded) {
removeDOMElement(content_ungated);
let content_gated = document.querySelector('div.content-gated');
if (content_gated) {
content_gated.classList.remove('content-gated');
let insider = document.querySelector('body.is-fp-insider');
if (insider) {
window.setTimeout(function () {
let json_script = getArticleJsonScript();
if (json_script) {
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);
}
}
}
}
else if (matchDomain('fortune.com')) {

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.2.2.2"
"version": "3.2.2.3"
}

@ -760,5 +760,5 @@
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.2.2.2"
"version": "3.2.2.3"
}

@ -628,7 +628,8 @@ var defaultSites = {
"Foreign Policy": {
domain: "foreignpolicy.com",
allow_cookies: 1,
block_regex: /\.tinypass\.com\//
block_regex: /\.tinypass\.com\//,
cs_dompurify: 1
},
"Fortune": {
domain: "fortune.com",

Loading…
Cancel
Save