Fix Economist inactive links

Plus remove banner from American Affairs (Journal).
merge-requests/1/head
magnolia1234 4 years ago committed by GitHub
parent 89f0d13f8c
commit 42ce0b8ffc

@ -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) {

Loading…
Cancel
Save