Fix NHST Media Group

This commit is contained in:
magnolia1234 2022-03-07 19:21:30 +01:00
parent ad0507a853
commit 2f5be5f6b2
4 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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);
}
}
}

View file

@ -631,5 +631,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.5.9.0"
"version": "2.5.9.1"
}

View file

@ -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",