Fix NzHerald
parent
20e3a04e8a
commit
be58a370e0
|
@ -91,23 +91,21 @@ if (window.location.href.indexOf("the-american-interest.com") !== -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
|
if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
|
||||||
const paywall = document.getElementById(
|
const paywall = document.getElementById('article-content');
|
||||||
"article-content"
|
|
||||||
);
|
|
||||||
if (paywall) {
|
if (paywall) {
|
||||||
|
const premium = document.getElementsByClassName('premium-sub')[0];
|
||||||
|
removeDOMElement(premium);
|
||||||
paywall.classList.remove('premium-content');
|
paywall.classList.remove('premium-content');
|
||||||
paywall.classList.add('full-content');
|
paywall.classList.add('full-content');
|
||||||
|
removeClassesByPrefix(paywall, 'QUnW');
|
||||||
var paras = paywall.querySelectorAll("p, span, h2, div");
|
var paras = paywall.querySelectorAll("p, span, h2, div");
|
||||||
var delClass = "";
|
for (var i = 0; i < paras.length; i++){
|
||||||
for (var i = paras.length; i--;) {
|
removeClassesByPrefix(paras[i], 'QUnW');
|
||||||
if (delClass == "") {
|
paras[i].classList.remove("ellipsis");
|
||||||
delClass = paras[i].className;
|
|
||||||
}
|
|
||||||
paras[i].classList.remove(delClass);
|
|
||||||
paras[i].removeAttribute('style');
|
paras[i].removeAttribute('style');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) {
|
if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
@ -175,3 +173,11 @@ function removeDOMElement(...elements) {
|
||||||
element.remove();
|
element.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeClassesByPrefix(el, prefix) {
|
||||||
|
for (var i = 0; i < el.classList.length; i++){
|
||||||
|
if(el.classList[i].startsWith(prefix)) {
|
||||||
|
el.classList.remove(el.classList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue