Fix LesEchos.fr (json)

Plus fix Challenges.fr (blur)
merge-requests/2/head
magnolia1234 3 years ago
parent 81e67d4673
commit d78494456d

@ -2,6 +2,8 @@
Changelog Bypass Paywalls Clean - Firefox Changelog Bypass Paywalls Clean - Firefox
Post-release Post-release
Fix Challenges.fr (blur)
Fix LesEchos.fr (json)
Fix WSJ & Barron's (amp) Fix WSJ & Barron's (amp)
* v2.3.6.0 (2021-09-05) * v2.3.6.0 (2021-09-05)

@ -807,9 +807,9 @@ else if (matchDomain('challenges.fr')) {
let amorce = document.querySelector('.user-paying-amorce'); let amorce = document.querySelector('.user-paying-amorce');
if (amorce) if (amorce)
amorce.setAttribute('style', 'display:none !important'); amorce.setAttribute('style', 'display:none !important');
let content = document.querySelector('.user-paying-content'); let content = document.querySelectorAll('.user-paying-content');
if (content) for (let elem of content)
content.setAttribute('style', 'display: block !important'); elem.classList.remove('user-paying-content');
let paywall = document.querySelector('.temp-paywall'); let paywall = document.querySelector('.temp-paywall');
removeDOMElement(paywall); removeDOMElement(paywall);
} }
@ -919,7 +919,7 @@ else if (matchDomain(['lejdd.fr', 'parismatch.com'])) {
else if (matchDomain('lesechos.fr') && window.location.href.match(/-\d{6,}/)) { else if (matchDomain('lesechos.fr') && window.location.href.match(/-\d{6,}/)) {
window.setTimeout(function () { window.setTimeout(function () {
let abo_banner = document.querySelector('[class^="pgxf3b"]'); let abo_banner = document.querySelector('div[class*="pgxf3b-2"]');
let ad_blocks = document.querySelectorAll('[class*="jzxvkd"'); let ad_blocks = document.querySelectorAll('[class*="jzxvkd"');
for (let ad_block of ad_blocks) for (let ad_block of ad_blocks)
ad_block.setAttribute('style', 'display:none'); ad_block.setAttribute('style', 'display:none');
@ -930,15 +930,18 @@ else if (matchDomain('lesechos.fr') && window.location.href.match(/-\d{6,}/)) {
let state; let state;
let split1 = html.split('window.__PRELOADED_STATE__=')[1]; let split1 = html.split('window.__PRELOADED_STATE__=')[1];
let split2 = split1.split('</script>')[0].trim(); let split2 = split1.split('</script>')[0].trim();
if (split2.includes('; window.__DATA__=')) if (split2.includes('; window.__DATA__=')) {
state = split2.split('; window.__DATA__=')[0].trim(); state = split2.split('; window.__DATA__=')[0].trim();
else if (state.length < 200)
state = split2.split('; window.__DATA__=')[1].split('; window.__')[0].trim();
} else
state = split2.substr(0, split2.length - 1); state = split2.substr(0, split2.length - 1);
try { try {
let data = JSON.parse(state); let data = JSON.parse(state);
let article = data.article.data.stripes[0].mainContent[0].data.description; let data_article = data.article ? data.article : data.pageProps;
let url_loaded = data.article.data.path; let article = data_article.data.stripes[0].mainContent[0].data.description;
if (!url.replace(/%20/g, '').includes(url_loaded)) let url_loaded = data_article.data.path;
if (url_loaded && !url.replace(/%20/g, '').includes(url_loaded))
window.location.reload(true); window.location.reload(true);
let paywallNode = document.querySelector('.post-paywall'); let paywallNode = document.querySelector('.post-paywall');
if (paywallNode) { if (paywallNode) {

@ -554,5 +554,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.3.6.1" "version": "2.3.6.2"
} }
Loading…
Cancel
Save