From b5607127f29611abeb9ea361eef6049cda182736 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 23 Jun 2019 12:42:33 -0700 Subject: [PATCH] Automatically close WSJ popup --- README.md | 2 +- contentScript.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5630429b..7412ede7 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ ### Sites with limited number of free articles The free article limit can normally be bypassed by removing cookies for the site.* -Install my [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. +Install the [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. When coming across a paywall click the cookie icon to remove the cookies then refresh the page. diff --git a/contentScript.js b/contentScript.js index c0a09b47..2a5edfb0 100644 --- a/contentScript.js +++ b/contentScript.js @@ -56,4 +56,10 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click(); } } +} else if (window.location.href.indexOf("wsj.com") !== -1) { + if (location.href.includes('/articles/')) { + setTimeout(function() { + document.querySelector('.close-btn').click(); + }, 2000); + } } \ No newline at end of file