From d9eb5473fce416c2350dd218f2fb47dda0e63beb Mon Sep 17 00:00:00 2001 From: Davide Saurino Date: Thu, 6 Dec 2018 22:23:04 +0100 Subject: [PATCH] Add repubblica.it --- README.md | 1 + background.js | 1 + contentScript.js | 13 ++++++++++++- options.js | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fdfb209..d06a226 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Hartford Courant (courant.com)\ Harvard Business Review (hbr.org)\ Het Financieele Dagblad (fd.nl)\ Inc.com (inc.com)\ +La Repubblica (repubblica.it)\ Le Temps (letemps.ch)\ Los Angeles Times (latimes.com)\ Medium (medium.com)\ diff --git a/background.js b/background.js index 9b45421..e7bada6 100644 --- a/background.js +++ b/background.js @@ -25,6 +25,7 @@ var defaultSites = { 'Harvard Business Review': 'hbr.org', 'Het Financieele Dagblad': 'fd.nl', 'Inc.com': 'inc.com', + 'La Repubblica': 'repubblica.it', 'Le Temps': 'letemps.ch', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', diff --git a/contentScript.js b/contentScript.js index e053308..5fcec35 100644 --- a/contentScript.js +++ b/contentScript.js @@ -29,4 +29,15 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { if (msg) { msg.style['display'] = 'none'; } -} \ No newline at end of file +} else if (location.hostname.endsWith('rep.repubblica.it')) { + if (location.href.includes("/pwa/")) { + location.href = location.href.replace("/pwa/", "/ws/detail/"); + } + + if (location.href.includes("/ws/detail/")) { + const paywall = document.getElementsByClassName('paywall'); + if (paywall && paywall.length > 0) { + paywall[0].toggleAttribute('amp-access-hide'); + } + } +} diff --git a/options.js b/options.js index 82ec200..3f28f37 100644 --- a/options.js +++ b/options.js @@ -23,6 +23,7 @@ var defaultSites = { 'Harvard Business Review': 'hbr.org', 'Het Financieele Dagblad': 'fd.nl', 'Inc.com': 'inc.com', + 'La Repubblica': 'repubblica.it', 'Le Temps': 'letemps.ch', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com',