Fix Wsj close-button doesn't exist

master
magnolia1234 2019-10-22 14:33:59 +02:00 committed by GitHub
parent c984827829
commit b3d38e3c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

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/')) {