From 2dabeaf373404e1a23a6393b9e074b02ca7fa1bc Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 20 Oct 2019 17:18:58 +0200 Subject: [PATCH 01/10] Maintenance background.js: sort & delete obsolete sites Sites only in remove_cookies settings are obsolete because cookies are erased by default (when not in allow_cookies). --- background.js | 91 +++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 53 deletions(-) diff --git a/background.js b/background.js index 847babe..3bfd0e7 100644 --- a/background.js +++ b/background.js @@ -101,74 +101,59 @@ const restrictions = { // Don't remove cookies before page load const allow_cookies = [ -'asia.nikkei.com', -'nytimes.com', -'wsj.com', -'ft.com', 'ad.nl', +'asia.nikkei.com', +'bostonglobe.com', +'chicagobusiness.com', +'demorgen.be', +'denverpost.com', +'economist.com', 'ed.nl', +'examiner.com.au', +'ft.com', +'hbr.org', +'medium.com', +'mercurynews.com', +'mexiconewsdaily.com', +'nymag.com', +'nytimes.com', 'parool.nl', +'telegraaf.nl', +'the-american-interest.com', +'theadvocate.com.au', +'theage.com.au', +'theaustralian.com.au', 'trouw.nl', 'vn.nl', 'volkskrant.nl', -'mercurynews.com', -'theage.com.au', -'economist.com', -'bostonglobe.com', -'denverpost.com', -'chicagobusiness.com', -'theadvocate.com.au', -'examiner.com.au', -'hbr.org', -'medium.com', 'washingtonpost.com', -'nymag.com', -'theaustralian.com.au', -'telegraaf.nl', // keep accept cookies -'demorgen.be', -'mexiconewsdaily.com', -'the-american-interest.com' +'wsj.com' ] // Removes cookies after page load const remove_cookies = [ -'asia.nikkei.com', 'ad.nl', -'ed.nl', -'vn.nl', -'ft.com', -'mercurynews.com', -'theage.com.au', -'economist.com', +'asia.nikkei.com', +'bloombergquint.com', 'bostonglobe.com', -'wired.com', -'denverpost.com', 'chicagobusiness.com', -'harpers.org', -'theadvocate.com.au', -'examiner.com.au', -'lesechos.fr', -'liberation.fr', -'hbr.org', -'theatlantic.com', -'medium.com', -'mexiconewsdaily.com', -'foreignpolicy.com', -'wsj.com', -'seattletimes.com', -'thenewsrep.com', -'washingtonpost.com', -'sfchronicle.com', -'nymag.com', -'scientificamerican.com', -'telegraaf.nl', -'thestar.com', -'qz.com', 'demorgen.be', -'sloanreview.mit.edu', -'zeit.de', -'firstthings.com', -'bloombergquint.com' +'denverpost.com', +'economist.com', +'ed.nl', +'examiner.com.au', +'ft.com', +'hbr.org', +'medium.com', +'mercurynews.com', +'mexiconewsdaily.com', +'nymag.com', +'telegraaf.nl', +'theadvocate.com.au', +'theage.com.au', +'vn.nl', +'washingtonpost.com', +'wsj.com' ] // Override User-Agent with Googlebot From 5b80e9dacfd920c22ccc82fd0c7f64401d413c0c Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 21 Oct 2019 21:32:09 +0200 Subject: [PATCH 02/10] Add Le Monde (lemonde.fr) Removing Le Monde paywall while keeping article recommendations in paywall-container. Also removes persistent cookie-banner which links to google.com (only visible with extension). --- README.md | 1 + background.js | 3 ++- contentScript.js | 23 +++++++++++++++++++++-- options.js | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a91d332..05eca40 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ [LA Business Journal](labusinessjournal.com)\ [La Repubblica](https://www.repubblica.it)\ [La Tercera](latercera.com)\ +[Le Monde](https://www.lemonde.fr)\ [Les Échos](https://lesechos.fr)\ [Libération](https://liberation.fr)\ [Loeb Classical Library](https://www.loebclassics.com)\ diff --git a/background.js b/background.js index 3bfd0e7..accea15 100644 --- a/background.js +++ b/background.js @@ -38,6 +38,7 @@ var defaultSites = { 'LA Business Journal': 'labusinessjournal.com', 'La Repubblica': 'repubblica.it', 'La Tercera': 'latercera.com', + 'Le Monde': 'lemonde.fr', 'Liberation': 'liberation.fr', 'Loeb Classical Library': 'loebclassics.com', 'Los Angeles Times': 'latimes.com', @@ -112,6 +113,7 @@ const allow_cookies = [ 'examiner.com.au', 'ft.com', 'hbr.org', +'lemonde.fr', 'medium.com', 'mercurynews.com', 'mexiconewsdaily.com', @@ -164,7 +166,6 @@ const use_google_bot = [ 'zeit.de', 'nytimes.com', 'mexiconewsdaily.com', -'nytimes.com', 'thetimes.co.uk', ] diff --git a/contentScript.js b/contentScript.js index 067a9f9..906b703 100644 --- a/contentScript.js +++ b/contentScript.js @@ -135,9 +135,28 @@ if (window.location.href.indexOf("bloombergquint.com") !== -1) { removeDOMElement(articlesLeftModal, paywall); } +if (window.location.href.indexOf('lemonde.fr') !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const hidden_section = document.getElementsByClassName('article__content--restricted-media')[0]; + if (hidden_section) + hidden_section.classList.remove('article__content--restricted-media'); + const longform_article_restricted = document.getElementsByClassName('article__content--restricted')[0]; + if (longform_article_restricted) + longform_article_restricted.classList.remove('article__content--restricted'); + const longform_paywall = document.getElementsByClassName('paywall--longform')[0]; + if (longform_paywall) + longform_paywall.classList.remove('paywall--longform'); + const paywall = document.getElementById('js-paywall-content'); + const friend_paywall = document.getElementsByClassName('friend--paywall')[0]; + const cookie_banner = document.getElementById('cookie-banner'); + removeDOMElement(paywall, friend_paywall, cookie_banner); + }); +} + + function removeDOMElement(...elements) { - for (var element of elements) { + for (let element of elements) { if (element) element.remove(); } -} +} \ No newline at end of file diff --git a/options.js b/options.js index 2b7b621..e11bab6 100644 --- a/options.js +++ b/options.js @@ -35,6 +35,7 @@ var defaultSites = { 'LA Business Journal': 'labusinessjournal.com', 'La Repubblica': 'repubblica.it', 'La Tercera': 'latercera.com', + 'Le Monde': 'lemonde.fr', 'Les Echos': 'lesechos.fr', 'Liberation': 'liberation.fr', 'Loeb Classical Library': 'loebclassics.com', From a6a331676a141f79c87b42af559176d014523414 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 22 Oct 2019 13:53:43 +0200 Subject: [PATCH 03/10] Fix Wsj with googlebot & mod=rsswn obsolete --- background.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/background.js b/background.js index accea15..3d0b7da 100644 --- a/background.js +++ b/background.js @@ -160,13 +160,14 @@ const remove_cookies = [ // Override User-Agent with Googlebot const use_google_bot = [ -'theaustralian.com.au', 'barrons.com', -'telegraph.co.uk', -'zeit.de', -'nytimes.com', 'mexiconewsdaily.com', +'nytimes.com', +'telegraph.co.uk', +'theaustralian.com.au', 'thetimes.co.uk', +'wsj.com', +'zeit.de', ] function setDefaultOptions() { @@ -223,6 +224,7 @@ chrome.runtime.onInstalled.addListener(function (details) { } }); +/** // WSJ bypass chrome.webRequest.onBeforeRequest.addListener(function (details) { if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { @@ -245,6 +247,7 @@ chrome.webRequest.onBeforeRequest.addListener(function (details) { {urls:["*://*.wsj.com/*"], types:["main_frame"]}, ["blocking"] ); +**/ // Disable javascript for these sites chrome.webRequest.onBeforeRequest.addListener(function(details) { From f31151402e2ca124415aded064ce6f2cc35669eb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 22 Oct 2019 13:55:48 +0200 Subject: [PATCH 04/10] Fix Wsj close-button doesn't exist --- contentScript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contentScript.js b/contentScript.js index 906b703..45c2dc9 100644 --- a/contentScript.js +++ b/contentScript.js @@ -61,7 +61,9 @@ if (window.location.href.indexOf("washingtonpost.com") !== -1) { if (window.location.href.indexOf("wsj.com") !== -1) { if (location.href.includes('/articles/')) { - document.querySelector('.close-btn').click(); + const close_button = document.querySelector('.close-btn'); + if (close_button) + close_button.click(); } } @@ -159,4 +161,4 @@ function removeDOMElement(...elements) { if (element) element.remove(); } -} \ No newline at end of file +} From 940784bf38b8303091b86f7c227687af39219a7f Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 23 Oct 2019 13:45:10 +0200 Subject: [PATCH 05/10] Fix Quartz (qz.com) --- background.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/background.js b/background.js index 3d0b7da..23ceb5e 100644 --- a/background.js +++ b/background.js @@ -120,6 +120,7 @@ const allow_cookies = [ 'nymag.com', 'nytimes.com', 'parool.nl', +'qz.com', 'telegraaf.nl', 'the-american-interest.com', 'theadvocate.com.au', @@ -150,6 +151,7 @@ const remove_cookies = [ 'mercurynews.com', 'mexiconewsdaily.com', 'nymag.com', +'qz.com', 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', From f1c6a32c116080b0669fe2df7730976ba93bb38f Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 23 Oct 2019 22:29:38 +0200 Subject: [PATCH 06/10] Harpers Magazine cookie-fix --- background.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/background.js b/background.js index 23ceb5e..d1b460f 100644 --- a/background.js +++ b/background.js @@ -112,6 +112,7 @@ const allow_cookies = [ 'ed.nl', 'examiner.com.au', 'ft.com', +'harpers.org', 'hbr.org', 'lemonde.fr', 'medium.com', @@ -146,6 +147,7 @@ const remove_cookies = [ 'ed.nl', 'examiner.com.au', 'ft.com', +'harpers.org', 'hbr.org', 'medium.com', 'mercurynews.com', From 1af2de6ae024658bf1f8b8b2da01a64ea7611511 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 25 Oct 2019 14:34:58 +0200 Subject: [PATCH 07/10] Fix WaPo gdpr cookie-banner (by holding on to wp_gdpr cookie) --- background.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index d1b460f..d855948 100644 --- a/background.js +++ b/background.js @@ -118,6 +118,7 @@ const allow_cookies = [ 'medium.com', 'mercurynews.com', 'mexiconewsdaily.com', +'nrc.nl', 'nymag.com', 'nytimes.com', 'parool.nl', @@ -152,6 +153,7 @@ const remove_cookies = [ 'medium.com', 'mercurynews.com', 'mexiconewsdaily.com', +'nrc.nl', 'nymag.com', 'qz.com', 'telegraaf.nl', @@ -162,6 +164,18 @@ const remove_cookies = [ 'wsj.com' ] +// select specific cookie(s) to hold from remove_cookies domains +const remove_cookies_select_hold = { + '.nrc.nl': ['nmt_closed_cookiebar'], + '.washingtonpost.com': ['wp_gdpr'], + '.wsj.com': ['wsjregion'] +} + +// select only specific cookie(s) to drop from remove_cookies domains +const remove_cookies_select_drop = { + 'www.nrc.nl': ['counter'] +} + // Override User-Agent with Googlebot const use_google_bot = [ 'barrons.com', @@ -369,9 +383,18 @@ chrome.webRequest.onCompleted.addListener(function(details) { continue; // don't remove cookies } chrome.cookies.getAll({domain: domainVar}, function(cookies) { - for (var i=0; i Date: Fri, 25 Oct 2019 18:44:39 +0200 Subject: [PATCH 08/10] =?UTF-8?q?Add=20L'=C3=89cho=20&=20La=20Naci=C3=B3n?= =?UTF-8?q?=20+=20typos/comments=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update background.js * Update README.md * Update options.js * Update background.js --- README.md | 12 +++++++----- background.js | 11 ++++++++--- options.js | 7 ++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 05eca40..c194d6c 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,11 @@ [Harvard Business Review](https://www.hbr.org)\ [Inc.com](https://www.inc.com)\ [Irish Times](https://www.irishtimes.com)\ -[LA Business Journal](labusinessjournal.com)\ +[L.A. Business Journal](https://labusinessjournal.com)\ +[La Nación](https://www.lanacion.com.ar)\ [La Repubblica](https://www.repubblica.it)\ -[La Tercera](latercera.com)\ +[La Tercera](https://latercera.com)\ +[L'Écho](https://lecho.be)\ [Le Monde](https://www.lemonde.fr)\ [Les Échos](https://lesechos.fr)\ [Libération](https://liberation.fr)\ @@ -58,7 +60,7 @@ [MIT Sloan Management Review](https://sloanreview.mit.edu)\ [MIT Technology Review](https://www.technologyreview.com)\ [Medium](https://www.medium.com)\ -[Mexicon News Daily](mexiconewsdaily.com)\ +[Mexicon News Daily](https://mexiconewsdaily.com)\ [NRC](https://www.nrc.nl)\ [New York Magazine](https://www.nymag.com)\ [New Zealand Herald](https://www.nzherald.co.nz)\ @@ -68,7 +70,7 @@ [Parool](https://www.parool.nl)\ [Quartz](https://qz.com)\ [Quora](https://www.quora.com)\ -[San Diego Union Tribune](sandiegouniontribune.com)\ +[San Diego Union Tribune](https://sandiegouniontribune.com)\ [San Francisco Chronicle](https://sfchronicle.com)\ [Scientific American](https://scientificamerican.com)\ [Statista](https://statista.com)\ @@ -131,7 +133,7 @@ Usually premium articles cannot be bypassed as they are behind a hard paywall. * If a site doesn't work try turning off uBlock and refreshing. * Make sure the site is checked under Options (on macOS sometimes the sites are unselected). -### Pull Requesets +### Pull Requests * PRs are welcome. ### Show your support diff --git a/background.js b/background.js index d855948..a0c11bf 100644 --- a/background.js +++ b/background.js @@ -1,5 +1,8 @@ +/* Please respect alphabetical order when adding a site in any list */ + 'use strict'; +// Cookies from this list are blocked by default var defaultSites = { 'Algemeen Dagblad': 'ad.nl', 'American Banker': 'americanbanker.com', @@ -18,8 +21,6 @@ var defaultSites = { 'DeMorgen': 'demorgen.be', 'Denver Post': 'denverpost.com', 'Dynamed Plus': 'dynamed.com', - 'The Economist': 'economist.com', - 'Les Echos': 'lesechos.fr', 'Eindhovens Dagblad': 'ed.nl', 'Encyclopedia Britannica': 'britannica.com', 'Examiner': 'examiner.com.au', @@ -35,12 +36,15 @@ var defaultSites = { 'Harvard Business Review': 'hbr.org', 'Inc.com': 'inc.com', 'Irish Times': 'irishtimes.com', - 'LA Business Journal': 'labusinessjournal.com', + 'La Nacion': 'lanacion.com.ar', 'La Repubblica': 'repubblica.it', 'La Tercera': 'latercera.com', + 'L\'Echo': 'lecho.be', 'Le Monde': 'lemonde.fr', + 'Les Echos': 'lesechos.fr', 'Liberation': 'liberation.fr', 'Loeb Classical Library': 'loebclassics.com', + 'Los Angeles Business Journal': 'labusinessjournal.com', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', 'Mexico News Daily': 'mexiconewsdaily.com', @@ -69,6 +73,7 @@ var defaultSites = { 'The Australian Financial Review': 'afr.com', 'The Boston Globe': 'bostonglobe.com', 'The Business Journals': 'bizjournals.com', + 'The Economist': 'economist.com', 'The Globe and Mail': 'theglobeandmail.com', 'The Japan Times': 'japantimes.co.jp', 'TheMarker': 'themarker.com', diff --git a/options.js b/options.js index e11bab6..d71db6c 100644 --- a/options.js +++ b/options.js @@ -16,7 +16,6 @@ var defaultSites = { 'DeMorgen': 'demorgen.be', 'Denver Post': 'denverpost.com', 'Dynamed Plus': 'dynamed.com', - 'The Economist (javascript disabled)': 'economist.com', 'Encyclopedia Britannica': 'britannica.com', 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', @@ -32,13 +31,15 @@ var defaultSites = { 'Harvard Business Review': 'hbr.org', 'Inc.com': 'inc.com', 'Irish Times': 'irishtimes.com', - 'LA Business Journal': 'labusinessjournal.com', + 'La Nacion': 'lanacion.com.ar', 'La Repubblica': 'repubblica.it', 'La Tercera': 'latercera.com', + 'L\'Echo': 'lecho.be', 'Le Monde': 'lemonde.fr', 'Les Echos': 'lesechos.fr', 'Liberation': 'liberation.fr', 'Loeb Classical Library': 'loebclassics.com', + 'Los Angeles Business Journal': 'labusinessjournal.com', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', 'Mexico News Daily': 'mexiconewsdaily.com', @@ -67,6 +68,7 @@ var defaultSites = { 'The Australian Financial Review (javascript disabled)': 'afr.com', 'The Boston Globe (javascript disabled)': 'bostonglobe.com', 'The Business Journals (javascript disabled)': 'bizjournals.com', + 'The Economist (javascript disabled)': 'economist.com', 'The Globe and Mail (javascript disabled)': 'theglobeandmail.com', 'The Japan Times': 'japantimes.co.jp', 'TheMarker': 'themarker.com', @@ -166,4 +168,3 @@ document.addEventListener('DOMContentLoaded', renderOptions); document.getElementById('save').addEventListener('click', save_options); document.getElementById('select-all').addEventListener('click', selectAll); document.getElementById('select-none').addEventListener('click', selectNone); - From 8d7d71d2b37ee62d9b94716968c18224fea27f1f Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 27 Oct 2019 13:43:43 +0100 Subject: [PATCH 09/10] Cookie correction Scientific American/Seattle Times/Les Echos A few sites still show paywall when cookies are blocked before loading instead of removed after loading page. Sites involved: Scientific American, Seattle Times and Les Echos (@iscreamcoke) Correction on earlier removal of 'obsolete' remove_cookies-only settings (other 12+ removed sites are fine). --- background.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index a0c11bf..723ea4d 100644 --- a/background.js +++ b/background.js @@ -120,6 +120,7 @@ const allow_cookies = [ 'harpers.org', 'hbr.org', 'lemonde.fr', +'lesechos.fr', 'medium.com', 'mercurynews.com', 'mexiconewsdaily.com', @@ -128,6 +129,8 @@ const allow_cookies = [ 'nytimes.com', 'parool.nl', 'qz.com', +'scientificamerican.com', +'seattletimes.com', 'telegraaf.nl', 'the-american-interest.com', 'theadvocate.com.au', @@ -144,7 +147,6 @@ const allow_cookies = [ const remove_cookies = [ 'ad.nl', 'asia.nikkei.com', -'bloombergquint.com', 'bostonglobe.com', 'chicagobusiness.com', 'demorgen.be', @@ -155,12 +157,15 @@ const remove_cookies = [ 'ft.com', 'harpers.org', 'hbr.org', +'lesechos.fr', 'medium.com', 'mercurynews.com', 'mexiconewsdaily.com', 'nrc.nl', 'nymag.com', 'qz.com', +'scientificamerican.com', +'seattletimes.com', 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', From c254d408c17fb1e6c83f3cd5ea3cccc3e00b19db Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 27 Oct 2019 16:03:01 -0700 Subject: [PATCH 10/10] Prepare for v1.5.6 release --- manifest.json | 2 +- updates.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 0490779..6eee755 100644 --- a/manifest.json +++ b/manifest.json @@ -20,5 +20,5 @@ "page": "options.html" }, "permissions": [ "cookies", "", "storage", "webRequest", "webRequestBlocking"], - "version": "1.5.5" + "version": "1.5.6" } diff --git a/updates.xml b/updates.xml index 2cf7d6a..adb7835 100644 --- a/updates.xml +++ b/updates.xml @@ -1,6 +1,6 @@ - +