Fix Wsj close-button doesn't exist

master
magnolia1234 2019-10-22 13:55:48 +02:00 committed by GitHub
parent a6a331676a
commit f31151402e
1 changed files with 4 additions and 2 deletions

View File

@ -61,7 +61,9 @@ if (window.location.href.indexOf("washingtonpost.com") !== -1) {
if (window.location.href.indexOf("wsj.com") !== -1) {
if (location.href.includes('/articles/')) {
document.querySelector('.close-btn').click();
const close_button = document.querySelector('.close-btn');
if (close_button)
close_button.click();
}
}
@ -159,4 +161,4 @@ function removeDOMElement(...elements) {
if (element)
element.remove();
}
}
}