From 81a30341a39c7921de3349384cecff7ed12d6222 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 24 Dec 2019 14:10:43 +0100 Subject: [PATCH] Fix Nrc.nl (paywall) New paywall-overlay for specific articles (test?). --- contentScript.js | 13 +++++++++++-- manifest.json | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/contentScript.js b/contentScript.js index 9e6eca9..f331fe8 100644 --- a/contentScript.js +++ b/contentScript.js @@ -165,8 +165,8 @@ if (window.location.href.indexOf('lemonde.fr') !== -1) { if (window.location.href.indexOf("nytimes.com") !== -1) { const preview_button = document.querySelector('.css-3s1ce0'); - if (preview_button) - preview_button.click(); + if (preview_button) + preview_button.click(); } if (window.location.href.indexOf("caixinglobal.com") !== -1) { @@ -213,6 +213,15 @@ if (window.location.href.indexOf("leparisien.fr") !== -1) { }, 300); // Delay (in milliseconds) } +if (window.location.href.indexOf("nrc.nl") !== -1) { + const paywall = document.querySelector('.has-paywall'); + if (paywall) + paywall.classList.remove("has-paywall"); + const paywall_overlay = document.querySelector('.has-paywall-overlay'); + if (paywall_overlay) + paywall_overlay.classList.remove("has-paywall-overlay"); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); diff --git a/manifest.json b/manifest.json index 828241b..d70f75f 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,8 @@ "*://*.washingtonpost.com/*", "*://*.economist.com/*", "*://*.the-tls.co.uk/*", - "*://*.leparisien.fr/*" + "*://*.leparisien.fr/*", + "*://*.nrc.nl/*" ], "js": ["contentScript.js"] }