Fix Wsj close-button doesn't exist

This commit is contained in:
magnolia1234 2019-10-22 14:33:59 +02:00 committed by GitHub
parent 061dda00aa
commit 94099458e0

View file

@ -70,8 +70,10 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) {
} else if (window.location.href.indexOf("wsj.com") !== -1) {
if (location.href.includes('/articles/')) {
setTimeout(function () {
document.querySelector('.close-btn').click();
}, 2000);
const close_button = document.querySelector('.close-btn');
if (close_button)
close_button.click();
}, 300);
}
} else if (window.location.href.indexOf("washingtonpost.com") !== -1) {
if (location.href.includes('/gdpr-consent/')) {