mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:17:46 +01:00
Fix NHST Media Group
This commit is contained in:
parent
ad0507a853
commit
2f5be5f6b2
4 changed files with 6 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
Changelog Bypass Paywalls Clean - Firefox
|
||||
|
||||
Post-release
|
||||
Fix NHST Media Group
|
||||
|
||||
* v2.5.9.0 (2022-03-06)
|
||||
Add Causeur.fr
|
||||
|
|
|
@ -3346,13 +3346,14 @@ else if (matchDomain(no_nhst_media_domains)) {
|
|||
window.setTimeout(function () {
|
||||
let paywall = document.querySelector('iframe#paywall-iframe');
|
||||
if (paywall && dompurify_loaded) {
|
||||
let article = paywall.parentNode;
|
||||
removeDOMElement(paywall);
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
response.text().then(html => {
|
||||
let split1 = html.split('window.__INITIAL_STATE__=')[1];
|
||||
let state = split1.split('};')[0] + '}';
|
||||
let state = (split1.split('};')[0] + '}').split('</script>')[0];
|
||||
if (state) {
|
||||
let json = JSON.parse(state);
|
||||
if (json) {
|
||||
|
@ -3360,10 +3361,9 @@ else if (matchDomain(no_nhst_media_domains)) {
|
|||
let parser = new DOMParser();
|
||||
let doc = parser.parseFromString('<div>' + DOMPurify.sanitize(json_text, {ADD_ATTR: ['itemprop'], ADD_TAGS: ['link']}) + '</div>', 'text/html');
|
||||
let article_new = doc.querySelector('div');
|
||||
let article = document.querySelector('div.article-body-preview');
|
||||
if (article_new) {
|
||||
if (article)
|
||||
article.parentNode.replaceChild(article_new, article);
|
||||
article.appendChild(article_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -631,5 +631,5 @@
|
|||
"*://*.wallkit.net/*",
|
||||
"*://*.wsj.net/*"
|
||||
],
|
||||
"version": "2.5.9.0"
|
||||
"version": "2.5.9.1"
|
||||
}
|
||||
|
|
2
sites.js
2
sites.js
|
@ -452,7 +452,7 @@ var defaultSites = {
|
|||
"blogfolha.uol.com.br"
|
||||
],
|
||||
allow_cookies: 1,
|
||||
block_regex: /(\.folha\.uol\.com\.br\/paywall\/js\/.+\/publicidade\.ads\.js|paywall\.folha\.uol\.com\.br\/|js\.matheranalytics\.com\/|cdn\.ampproject\.org\/v\d\/amp-((sticky-)?ad|subscriptions)-.+\.js)/
|
||||
block_regex: /(\.folha\.uol\.com\.br\/paywall\/js\/|js\.matheranalytics\.com\/|cdn\.ampproject\.org\/v\d\/amp-((sticky-)?ad|subscriptions)-.+\.js)/
|
||||
},
|
||||
"Follow the Money (ftm.nl)": {
|
||||
domain: "ftm.nl",
|
||||
|
|
Loading…
Reference in a new issue