Fix NHST Media Group (js)

merge-requests/16/head
magnolia1234 8 months ago
parent 25001ed17b
commit 8d806669b6

@ -6,6 +6,7 @@ Post-release
Add Interesting Engineering
Fix Media Group Westfalen
Fix Mediahuis Nederland Regional (js)
Fix NHST Media Group (js)
Fix The Atlantic (images)
* v3.3.6.0 (2023-10-01)

@ -5221,43 +5221,12 @@ else if (matchDomain(no_nhst_media_domains)) {
if (blurred)
blurred.removeAttribute('style');
} else {
window.setTimeout(function () {
let paywall = document.querySelector('iframe#paywall-iframe, div#sub-paywall-container');
if (paywall && dompurify_loaded) {
let article = paywall.parentNode;
removeDOMElement(paywall);
fetch(url)
.then(response => {
if (response.ok) {
response.text().then(html => {
if (html.includes('window.__INITIAL_STATE__=')) {
let split1 = html.split('window.__INITIAL_STATE__=')[1];
let state = (split1.split('};')[0] + '}').split('</script>')[0];
if (state) {
try {
let json = JSON.parse(state);
if (json) {
let json_text = json.article.body;
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');
if (article && article_new)
article.appendChild(article_new);
let intro = document.querySelector('div.global-article-selector');
let promo = document.querySelectorAll('div[data-ah5-type="promobox"], div.dn-relation-block');
removeDOMElement(intro, ...promo);
}
} catch (err) {
console.log(err);
}
}
} else
header_nofix(article);
})
}
})
}
}, 500);
let fade = document.querySelector('div[style*="background-image: linear-gradient"]');
if (fade) {
removeDOMElement(fade);
let header = document.querySelector('div.article-body > div');
header_nofix(header);
}
}
}
@ -5637,7 +5606,7 @@ function matchUrlDomain(domains, url) {
function header_nofix(header, msg = 'BPC > no fix') {
if (header) {
let nofix_div = document.createElement('div');
nofix_div.setAttribute('style', 'margin: 20px; font-weight: bold; color: red;');
nofix_div.setAttribute('style', 'margin: 20px; font-size: 20px; font-weight: bold; color: red;');
nofix_div.innerText = msg;
header.before(nofix_div);
}
@ -5830,7 +5799,7 @@ function ext_12ftLink(url, text_fail = 'BPC > Try for full article text:\r\n') {
function externalLink(domains, ext_url_templ, url, text_fail = 'BPC > Full article text:\r\n') {
let text_fail_div = document.createElement('div');
text_fail_div.id = 'bpc_archive';
text_fail_div.setAttribute('style', 'margin: 20px; font-size: 15px; font-weight: bold; color: red;');
text_fail_div.setAttribute('style', 'margin: 20px; font-size: 20px; font-weight: bold; color: red;');
let parser = new DOMParser();
text_fail = text_fail.replace(/\[([^\]]+)\]/g, "<a href='$1' target='_blank' style='color: red'>$1</a>");
let doc = parser.parseFromString('<span>' + text_fail + '</span>', 'text/html');

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.3.6.3"
"version": "3.3.6.4"
}

@ -643,6 +643,13 @@
"block_regex": "js\\.pelcro\\.com",
"domain": "theday.com"
},
"Thedispatch.com": {
"add_ext_link": "article:not(.newsletter) section.paywall-section|div.content",
"add_ext_link_type": "archive.is",
"allow_cookies": 1,
"domain": "thedispatch.com",
"ld_json_url": "article.newsletter section.paywall-section|div.content|1"
},
"Thedriftmag.com": {
"allow_cookies": 1,
"block_regex": "\\.thedriftmag\\.com\\/wp-content\\/plugins\\/drift-paywall-plugin",

@ -792,11 +792,12 @@
"*://*.kinja-static.com/*",
"*://*.medscapestatic.com/*",
"*://*.ndcmediagroep.nl/*",
"*://*.nhst.tech/*",
"*://*.nyt.com/*",
"*://*.pasedigital.cl/*",
"*://*.tnet.nl/*",
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.3.6.3"
"version": "3.3.6.4"
}

@ -1621,8 +1621,7 @@ var defaultSites = {
"upstreamonline.com"
],
allow_cookies: 1,
cs_dompurify: 1,
referer: "facebook"
block_regex: /subscription-static-global\.nhst\.tech\//
},
"Nikkei Asian Review": {
domain: "asia.nikkei.com",

@ -36,6 +36,7 @@
],
"allow_cookies": 1,
"block_regex": "\\.tnet\\.nl\\/static\\/assets\\/js\\/login_v\\d\\.js",
"cs_dompurify": 1,
"upd_version": "3.3.6.1"
},
"Mexico News Daily": {
@ -44,6 +45,22 @@
"block_regex": "\\/mexiconewsdaily\\.com\\/wp-content\\/plugins\\/leaky-paywall\\/js\\/leaky-paywall-cookie\\.js",
"upd_version": "3.3.5.2"
},
"NHST Media Group": {
"domain": "###_no_nhst_media",
"group": [
"europower.no",
"fiskeribladet.no",
"intrafish.com",
"intrafish.no",
"rechargenews.com",
"tradewindsnews.com",
"upstreamonline.com"
],
"allow_cookies": 1,
"block_regex": "subscription-static-global\\.nhst\\.tech",
"cs_dompurify": 1,
"upd_version": "3.3.6.4"
},
"Salzburger Nachrichten": {
"domain": "sn.at",
"allow_cookies": 1,

Loading…
Cancel
Save