mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-09-20 04:43:42 +02:00
Fix Foreign Policy (Insider)
This commit is contained in:
parent
a5f8123f43
commit
3f62ad7290
5 changed files with 30 additions and 7 deletions
|
@ -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');
|
||||
if (content_ungated && dompurify_loaded) {
|
||||
removeDOMElement(content_ungated);
|
||||
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');
|
||||
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"
|
||||
}
|
||||
|
|
3
sites.js
3
sites.js
|
@ -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…
Reference in a new issue