From 517e845f1a3af6fae3462f955fc2416a6f716e24 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 16 Mar 2021 18:10:41 +0100 Subject: [PATCH] Add Entrepreneur --- README.md | 1 + background.js | 1 + changelog.txt | 1 + contentScript.js | 24 +++++++++++++++++++++++- manifest.json | 3 ++- sites.js | 1 + 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 298b5d3..6fdf57f 100755 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ _* free articles only._ [Bloomberg](https://www.bloomberg.com) - [Business Insider](https://www.businessinsider.com) - [Digiday](https://digiday.com) – +[Entrepreneur](https://www.entrepreneur.com) - [Fortune](https://fortune.com) - [Harvard Business Review](https://www.hbr.org) - [Inc.com](https://www.inc.com) - diff --git a/background.js b/background.js index 0f1274c..26b3e61 100755 --- a/background.js +++ b/background.js @@ -55,6 +55,7 @@ var allow_cookies_default = [ 'elmundo.es', 'elpais.com', 'elperiodico.com', + 'entrepreneur.com', 'esprit.presse.fr', 'euobserver.com', 'eurekareport.com.au', diff --git a/changelog.txt b/changelog.txt index 57480ec..a8a648b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add Entrepreneur * v2.1.2.0 (2021-03-14) Add El Espanol (Spain) diff --git a/contentScript.js b/contentScript.js index 4e392e3..0aee248 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1225,7 +1225,7 @@ else if (matchDomain("sueddeutsche.de")) { document.addEventListener('DOMContentLoaded', () => { let offer_page = document.querySelector('div.offer-page'); if (url.startsWith('https://www.sueddeutsche.de') && (url.includes('reduced=true') || offer_page)) - window.location.href = url.split('?')[0].replace('www.', 'amphtml.'); + window.location.href = url.split('?')[0].split('!')[0].replace('www.', 'amphtml.'); else if (url.startsWith('https://sz-magazin.sueddeutsche.de')) { if (url.includes('reduced=true') || offer_page) window.location.href = new URL(url).pathname + '!amp'; @@ -2203,6 +2203,28 @@ else if (matchDomain('elespanol.com')) { removeDOMElement(...adverts); } +else if (matchDomain('entrepreneur.com')) { + let promo = document.querySelector('.paywall-promo'); + if (promo) { + removeDOMElement(promo); + let gate_check = document.querySelector('.gate-check'); + if (gate_check) + gate_check.removeAttribute('class'); + let hidden_images = document.querySelectorAll('img.lazy[src*="blur"][data-src]'); + for (let hidden_image of hidden_images) + hidden_image.setAttribute('src', hidden_image.getAttribute("data-src")); + } +} + +else if (matchDomain('rheinpfalz.de')) { + let url = window.location.href; + if (url.includes('reduced=true')) { + window.setTimeout(function () { + window.location.href = url.split('?')[0]; + }, 500); // Delay (in milliseconds) + } +} + else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) csDone = true; diff --git a/manifest.json b/manifest.json index aaaa45f..cbc8e26 100755 --- a/manifest.json +++ b/manifest.json @@ -127,6 +127,7 @@ "*://*.elnortedecastilla.es/*", "*://*.elpais.com/*", "*://*.elperiodico.com/*", + "*://*.entrepreneur.com/*", "*://*.esprit.presse.fr/*", "*://*.estadao.com.br/*", "*://*.estrellavalpo.cl/*", @@ -477,5 +478,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.2.0" + "version": "2.1.2.1" } \ No newline at end of file diff --git a/sites.js b/sites.js index 532f574..dff50ec 100755 --- a/sites.js +++ b/sites.js @@ -60,6 +60,7 @@ var defaultSites = "El País": "elpais.com", "El Periódico (de Catalunya)": "elperiodico.com", "Encyclopedia Britannica": "britannica.com", + "Entrepreneur": "entrepreneur.com", "Esprit": "esprit.presse.fr", "EUobserver": "euobserver.com", "Eureka Report": "eurekareport.com.au",