mirror of
https://github.com/iamadamdev/bypass-paywalls-chrome
synced 2025-05-28 18:20:13 +02:00
Fix NzHerald
This commit is contained in:
parent
bb98f49efc
commit
aa60e65e1a
@ -91,23 +91,21 @@ if (window.location.href.indexOf("the-american-interest.com") !== -1) {
|
||||
}
|
||||
|
||||
if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
|
||||
const paywall = document.getElementById(
|
||||
"article-content"
|
||||
);
|
||||
const paywall = document.getElementById('article-content');
|
||||
if (paywall) {
|
||||
const premium = document.getElementsByClassName('premium-sub')[0];
|
||||
removeDOMElement(premium);
|
||||
paywall.classList.remove('premium-content');
|
||||
paywall.classList.add('full-content');
|
||||
removeClassesByPrefix(paywall, 'QUnW');
|
||||
var paras = paywall.querySelectorAll("p, span, h2, div");
|
||||
var delClass = "";
|
||||
for (var i = paras.length; i--;) {
|
||||
if (delClass == "") {
|
||||
delClass = paras[i].className;
|
||||
}
|
||||
paras[i].classList.remove(delClass);
|
||||
for (var i = 0; i < paras.length; i++){
|
||||
removeClassesByPrefix(paras[i], 'QUnW');
|
||||
paras[i].classList.remove("ellipsis");
|
||||
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) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
@ -175,3 +173,11 @@ function removeDOMElement(...elements) {
|
||||
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…
x
Reference in New Issue
Block a user