From 3cb1435cd5e20938e4b8702bba309b55d74df2d4 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Mon, 14 Oct 2019 14:52:27 +0200 Subject: [PATCH] Dutch papers/magazines Adding Dutch papers: ad.nl, ed.nl, parool.nl, trouw.nl, telegraaf.nl Adding Dutch magazines: groene.nl, vn.nl Sites added to manifest.json to make contentScrip.js active (also added missing wsj.com, washingtonpost.com & nzherald.co.nz). --- README.md | 7 +++++++ background.js | 20 ++++++++++++++++++-- contentScript.js | 23 +++++++++++++++++++++++ manifest.json | 19 +++++++++++++++++-- options.js | 7 +++++++ 5 files changed, 72 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da6ef1d..13f7f3d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ### Bypass the following sites' paywalls with this extension +[Algemeen Dagblad](https://www.ad.nl)\ [Baltimore Sun](https://www.baltimoresun.com)\ [Barron's](https://www.barrons.com)\ [Bloomberg](https://www.bloomberg.com)\ @@ -16,9 +17,11 @@ [Corriere Della Sera](https://www.corriere.it)\ [Daily Press](https://www.dailypress.com)\ [Denver Post](https://www.denverpost.com)\ +[De Groene Amsterdammer](https://www.groene.nl)\ [De Tijd](https://www.tijd.be)\ [de Volkskrant](https://www.volkskrant.nl)\ [The Economist](https://www.economist.com)\ +[Eindhovens Dagblad](https://ed.nl)\ [Examiner](https://www.examiner.com.au)\ [Financial Times](https://www.ft.com)\ [Foreign Policy](https://www.foreignpolicy.com)\ @@ -46,10 +49,12 @@ [Orange County Register](https://www.ocregister.com)\ [Orlando Sentinel](https://www.orlandosentinel.com)\ [Palo Alto Online](https://www.paloaltoonline.com)\ +[Parool](https://www.parool.nl)\ [Quartz](https://qz.com)\ [Quora](https://www.quora.com)\ [Statista](https://www.statista.com)\ [SunSentinel](https://www.sun-sentinel.com)\ +[Telegraaf](https://telegraaf.nl)\ [The Advocate](https://www.theadvocate.com.au)\ [The Age](https://www.theage.com.au)\ [The Atlantic](https://www.theatlantic.com)\ @@ -78,7 +83,9 @@ [The Washington Post](https://www.washingtonpost.com)\ [The Wall Street Journal](https://www.wsj.com)\ [Towards Data Science](https://www.towardsdatascience.com)\ +[Trouw](https://www.trouw.nl)\ [Vanity Fair](https://www.vanityfair.com)\ +[Vrij Nederland](https://www.vn.nl)\ [Wired](https://www.wired.com) ### Sites with limited number of free articles diff --git a/background.js b/background.js index 89e4f3a..ca06a2f 100644 --- a/background.js +++ b/background.js @@ -1,6 +1,7 @@ 'use strict'; var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', @@ -14,8 +15,10 @@ var defaultSites = { 'Daily Press': 'dailypress.com', 'Denver Post': 'denverpost.com', 'De Tijd': 'tijd.be', + 'De Groene Amsterdammer': 'groene.nl', 'de Volkskrant': 'volkskrant.nl', 'The Economist': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', 'Financial Times': 'ft.com', 'Foreign Policy': 'foreignpolicy.com', @@ -43,9 +46,11 @@ var defaultSites = { 'Orange County Register': 'ocregister.com', 'Orlando Sentinel': 'orlandosentinel.com', 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Statista': 'statista.com', + 'Telegraaf': 'telegraaf.nl', 'SunSentinel': 'sun-sentinel.com', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', @@ -74,7 +79,9 @@ var defaultSites = { 'The Washington Post': 'washingtonpost.com', 'The Wall Street Journal': 'wsj.com', 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', 'Wired': 'wired.com' }; @@ -106,7 +113,13 @@ const allow_cookies = [ 'hbr.org', 'nymag.com', 'theaustralian.com.au', -'volkskrant.nl', +'ad.nl', +'ed.nl', +'parool.nl', +'telegraaf.nl', +'trouw.nl', +'vn.nl', +'volkskrant.nl' ] // Removes cookies after page load @@ -140,13 +153,16 @@ const remove_cookies = [ 'washingtonpost.com', 'nymag.com', 'nationalpost.com', -'volkskrant.nl', 'handelsblatt.com', 'thediplomat.com', 'latimes.com', 'theatlantic.com', 'chicagobusiness.com', 'qz.com', +'ad.nl', +'ed.nl', +'telegraaf.nl', +'vn.nl' ] // Override User-Agent with Googlebot diff --git a/contentScript.js b/contentScript.js index 154c703..0435762 100644 --- a/contentScript.js +++ b/contentScript.js @@ -88,4 +88,27 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } }, 300); // Delay (in milliseconds) } +} else if (window.location.href.indexOf('telegraaf.nl') !== -1) { + const paywall = document.getElementById('TEMPRORARY_METERING_ID'); + if (paywall) { + window.location.reload(1); + } +} else if (window.location.href.indexOf('ed.nl') !== -1) { + const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); + if (paywall) { + paywall.remove(); + paywall = null; + } +} else if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); + const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); + removeDOMElement(paywall, hidden_section); + }); +} + +function removeDOMElement(...elements) { + for (let element of elements) { + if (element) element.remove(); + } } diff --git a/manifest.json b/manifest.json index 1f58a10..f0d4167 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,15 @@ "*://*.bizjournals.com/*", "*://*.businessinsider.com/*", "*://*.haaretz.co.il/*", - "*://*.repubblica.it/*" + "*://*.nzherald.co.nz/*", + "*://*.repubblica.it/*", + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.ed.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.volkskrant.nl/*" ], "js": ["contentScript.js"] } @@ -121,7 +129,14 @@ "*://*.wired.com/*", "*://*.thediplomat.com/*", "*://*.theatlantic.com/*", - "*://*.qz.com/*" + "*://*.qz.com/*", + "*://*.ad.nl/*", + "*://*.ed.nl/*", + "*://*.groene.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.vn.nl/*" ], "version": "1.5.9" } diff --git a/options.js b/options.js index 694161e..dfc1a74 100644 --- a/options.js +++ b/options.js @@ -1,4 +1,5 @@ var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', @@ -11,9 +12,11 @@ var defaultSites = { 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', 'Denver Post': 'denverpost.com', + 'De Groene Amsterdammer': 'groene.nl', 'De Tijd': 'tijd.be', 'de Volkskrant': 'volkskrant.nl', 'The Economist (javascript disabled)': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', 'Financial Times': 'ft.com', 'Foreign Policy': 'foreignpolicy.com', @@ -41,10 +44,12 @@ var defaultSites = { 'Orange County Register': 'ocregister.com', 'Orlando Sentinel': 'orlandosentinel.com', 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Statista': 'statista.com', 'SunSentinel': 'sun-sentinel.com', + 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', 'The Atlantic': 'theatlantic.com', @@ -73,7 +78,9 @@ var defaultSites = { 'The Washington Post': 'washingtonpost.com', 'The Wall Street Journal': 'wsj.com', 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', 'Wired': 'wired.com' };