Fix-update LesEchos.fr (json)

master
magnolia1234 2020-11-25 19:39:27 +01:00
parent a475b53ee6
commit 86cdf94bcc
3 changed files with 9 additions and 3 deletions

View File

@ -7,6 +7,7 @@ Add Grupo Vocento (Spain, regional daily)
Add The Hindu BusinessLine (India)
Fix-update Corriere Della Sera (redirect preview)
Fix-update Faz.net (error in json)
Fix-update LesEchos.fr (json)
Fix popup (update notification & close error)
Update block general paywall script (Pelcro)
Update grouped sites (init rules)

View File

@ -680,9 +680,13 @@ else if (matchDomain("lesechos.fr") && window.location.href.match(/-\d{6,}/)) {
removeDOMElement(abo_banner);
let url = window.location.href;
let html = document.documentElement.outerHTML;
let split1 = html.split('window.__PRELOADED_STATE__')[1];
let state;
let split1 = html.split('window.__PRELOADED_STATE__=')[1];
let split2 = split1.split('</script>')[0].trim();
let state = split2.substr(1, split2.length - 2);
if (split2.includes('; window.__DATA__='))
state = split2.split('; window.__DATA__=')[0].trim();
else
state = split2.substr(0, split2.length - 1);
try {
let data = JSON.parse(state);
let article = data.article.data.stripes[0].mainContent[0].data.description;

View File

@ -4,8 +4,9 @@ var manifestData = ext_api.runtime.getManifest();
var versionString = 'v' + manifestData.version;
document.getElementById('version').innerText = versionString;
const proxyurl = "https://cors-anywhere.herokuapp.com/";
const manifest_new = 'https://gitlab.com/magnolia1234/bypass-paywalls-chrome-clean/-/raw/master/manifest.json';
fetch(manifest_new, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } })
fetch(proxyurl + manifest_new, { headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } })
.then(response => {
if (response.ok) {
response.json().then(json => {