From 1c1d97e3ad371af6aba023ed1988fab7c11f6a1c Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 5 Jan 2020 18:04:40 +0100 Subject: [PATCH] Fix various banners Fix banners on TheTimes.co.uk, Bloomberg, Asia Nikkei, Haaretz.com & Hbr.org --- contentScript.js | 24 ++++++++++++++++++++++-- manifest.json | 6 +++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/contentScript.js b/contentScript.js index f521a5f0..fad514c4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -118,9 +118,9 @@ if (window.location.href.indexOf("bloomberg.com") !== -1) { if (fence){ fence.classList.remove('fence-body'); } - const paywall = document.getElementById('paywall-banner'); - removeDOMElement(paywall); }); + const banner = document.getElementById('paywall-banner'); + removeDOMElement(banner); } if (window.location.href.indexOf('telegraaf.nl') !== -1) { @@ -299,6 +299,26 @@ if (window.location.href.indexOf("technologyreview.com") !== -1) { removeDOMElement(meter); } +if (window.location.href.indexOf("thetimes.co.uk") !== -1) { + const block = document.querySelector('.subscription-block'); + removeDOMElement(block); +} + +if (window.location.href.indexOf("haaretz.com") !== -1) { + const popup = document.querySelector('.footer-ruler'); + removeDOMElement(popup); +} + +if (window.location.href.indexOf("asia.nikkei.com") !== -1) { + const popup = document.querySelector('.pw-widget--popup'); + removeDOMElement(popup); +} + +if (window.location.href.indexOf("hbr.org") !== -1) { + const popup = document.querySelector('.persistent-banner'); + removeDOMElement(popup); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); diff --git a/manifest.json b/manifest.json index 41a3c573..f8e89432 100644 --- a/manifest.json +++ b/manifest.json @@ -32,7 +32,11 @@ "*://*.afr.com/*", "*://*.theglobeandmail.com/*", "*://*.scribd.com/*", - "*://*.technologyreview.com/*" + "*://*.technologyreview.com/*", + "*://*.thetimes.co.uk/*", + "*://*.haaretz.com/*", + "*://*.asia.nikkei.com/*", + "*://*.hbr.org/*" ], "js": ["contentScript.js"] }