Fix Economist inactive links

Plus remove banner from American Affairs (Journal).
This commit is contained in:
magnolia1234 2020-03-08 23:16:17 +01:00 committed by GitHub
parent 89f0d13f8c
commit 42ce0b8ffc

View file

@ -195,6 +195,19 @@ if (window.location.href.indexOf("economist.com") !== -1) {
window.location.reload(true);
}
}, 600); // Delay (in milliseconds)
const p_article = document.querySelectorAll('p.article__body-text');
var href;
for (let i = 0; i < p_article.length; i++) {
const anchor = document.querySelectorAll('a');
href = '';
for (let j = 0; j < anchor.length; j++) {
if (anchor[j].href) {
href = anchor[j].href;
} else {
anchor[j].href = href;
}
}
}
});
}
@ -422,6 +435,11 @@ if (window.location.href.indexOf("newyorker.com") !== -1) {
removeDOMElement(paywall_bar);
}
if (window.location.href.indexOf("americanaffairsjournal.org") !== -1) {
const paywall_bar = document.querySelector('.paywall-notification-bar-wrapper');
removeDOMElement(paywall_bar);
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {