|
|
|
@ -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');
|
|
|
|
|