diff --git a/changelog.txt b/changelog.txt index 31ab18a..4cb084b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Fix Mediahuis Noord (json) * v3.3.0.0 (2023-08-20) Add Cieletespace.fr diff --git a/contentScript.js b/contentScript.js index 0162e02..c014066 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2249,11 +2249,13 @@ else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('link[href* let html = document.documentElement.outerHTML; if (html.includes('window.__NUXT__=')) { let json = html.split('window.__NUXT__=')[1].split('')[0].trim(); - let url_nuxt = json.match(/[(,]null,/) ? json.split(/[(,]null,/)[1].match(/\d+\.(html|ece)/)[0] : false; + let url_nuxt = json.includes(',canonical:"') ? json.split(',canonical:"')[1].match(/\d+\.(html|ece)/)[0] : false; + if (!url_nuxt) + url_nuxt = json.match(/[(,]null,/) ? json.split(/[(,]null,/)[1].match(/\d+\.(html|ece)/)[0] : false; if (url_nuxt && !window.location.pathname.includes(url_nuxt)) refreshCurrentTab(); else if (json.includes(',body:')) { - let json_text = json.split(',body:')[1].split(/,(leadText|brand_key|tts):/)[0].replace(/([{,])([a-zA-Z_0-9]+\d?):/g, "$1\"$2\":").replace(/\":(\[)?([\w\$\.]+)([\]},])/g, "\":$1\"$2\"$3"); + let json_text = json.split(',body:')[1].split(/,(leadText|brand_key|tts):/)[0].replace(/([{,])(((__)?type(name)?|attributes|author|caption|children|code|href|id|image(Alt|Url)|insertbox_(head|text)|key|link|photographer|rel|relation|section|sourceId|target|text|title|url|value)\d?)(?=:)/g, "$1\"$2\"").replace(/(Image\\":)(\d)([,}])/g, '$1\\"$2\\"$3').replace(/\":(\[)?([\w\$\.]+)([\]},])/g, "\":$1\"$2\"$3"); let article = document.querySelector('div.content'); if (article) { article.innerHTML = ''; @@ -2270,12 +2272,10 @@ else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('link[href* } for (let par of pars) { let elem = document.createElement('p'); - if (par.typename === 'HTMLCustomEmbed') { - if (par.code) { - let parser = new DOMParser(); - let article_html = parser.parseFromString('