Fix Mediahuis Noord (json)

This commit is contained in:
magnolia1234 2023-08-21 20:38:38 +02:00
parent 48f62fe785
commit d8a84217bc
6 changed files with 23 additions and 11 deletions

View file

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

View file

@ -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('</script>')[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('<div>' + DOMPurify.sanitize(par.code, {ADD_TAGS: ['iframe']}) + '</div>', 'text/html');
elem = article_html.querySelector('div');
}
if (par.code) {
let parser = new DOMParser();
let article_html = parser.parseFromString('<div>' + DOMPurify.sanitize(par.code, {ADD_TAGS: ['iframe']}) + '</div>', 'text/html');
elem = article_html.querySelector('div');
} else if (par.insertbox_head || par.insertbox_text) {
if (par.insertbox_head && par.insertbox_head.length > 2) {
addParText(elem, par.insertbox_head, true);

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.3.0.0"
"version": "3.3.0.1"
}

View file

@ -790,5 +790,5 @@
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.3.0.0"
"version": "3.3.0.1"
}

View file

@ -1420,7 +1420,7 @@ var defaultSites = {
"lc.nl"
],
allow_cookies: 1,
block_regex: /(\.evolok\.net\/|\.ndcmediagroep\.nl\/js\/evolok\/)/,
block_regex: /(\.evolok\.net\/|\.ndcmediagroep\.nl\/js\/evolok\/|\.nl\/_\/zh\/worker)/,
cs_dompurify: 1
},
"MediaNews Group": {

View file

@ -62,6 +62,17 @@
"remove_cookies_select_drop": ["blaize_session"],
"upd_version": "3.2.8.8"
},
"Mediahuis Noord": {
"domain": "###_nl_mediahuis_noord",
"group": [
"dvhn.nl",
"lc.nl"
],
"allow_cookies": 1,
"block_regex": "(\\.evolok\\.net\\/|\\.ndcmediagroep\\.nl\\/js\\/evolok\\/|\\.nl\\/_\\/zh\\/worker)",
"cs_dompurify": 1,
"upd_version": "3.3.0.1"
},
"Piano.io (+ TinyPass)": {
"domain": "piano.io",
"allow_cookies": 1,