From b3d38e3c24adaf61226f8921d3d6975a193eaac5 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 14:33:59 +0200 Subject: [PATCH] Fix Wsj close-button doesn't exist --- contentScript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contentScript.js b/contentScript.js index 76b9115..1b1f827 100644 --- a/contentScript.js +++ b/contentScript.js @@ -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/')) {