From 191377482d07ff6ff98bbd1249322a0306895667 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 13 Nov 2019 12:35:23 +0100 Subject: [PATCH 1/6] Fix The Atlantic (cookie) --- background.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/background.js b/background.js index c747260..177f3ab 100644 --- a/background.js +++ b/background.js @@ -123,6 +123,7 @@ const allow_cookies = [ 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', +'theatlantic.com', 'theaustralian.com.au', 'thediplomat.com', 'thestar.com', @@ -161,6 +162,7 @@ const remove_cookies = [ 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', +'theatlantic.com', 'thediplomat.com', 'thestar.com', 'towardsdatascience.com', From dcb86b90ea86a42f14cf5c9282e9f5fd2d8881cc Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 13 Nov 2019 13:12:24 +0100 Subject: [PATCH 2/6] Fix Telegraaf.nl (timing issue) Fix for persistent refreshing at paywall-banner. --- contentScript.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contentScript.js b/contentScript.js index 89526db..556ffa1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -120,10 +120,12 @@ if (window.location.href.indexOf("bloomberg.com") !== -1) { } if (window.location.href.indexOf('telegraaf.nl') !== -1) { - const paywall = document.getElementById('TEMPRORARY_METERING_ID'); - if (paywall) { - window.location.reload(1); - } + setTimeout(function () { + const paywall = document.getElementById('TEMPRORARY_METERING_ID'); + if (paywall) { + window.location.reload(true); + } + }, 500); // Delay (in milliseconds) } if (window.location.href.indexOf('ed.nl') !== -1) { From 5e54e795d35e0afa53d7424ddfab87e3e58570cc Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Thu, 14 Nov 2019 12:22:48 +0100 Subject: [PATCH 3/6] Fix Bloomberg Fixes issue https://github.com/iamadamdev/bypass-paywalls-chrome/issues/399 --- contentScript.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contentScript.js b/contentScript.js index 556ffa1..5312c80 100644 --- a/contentScript.js +++ b/contentScript.js @@ -114,6 +114,9 @@ if (window.location.href.indexOf("bloombergquint.com") !== -1) { if (window.location.href.indexOf("bloomberg.com") !== -1) { document.addEventListener('DOMContentLoaded', () => { + const fence = document.querySelector('.fence-body'); + if (fence) + fence.classList.remove('fence-body'); const paywall = document.getElementById('paywall-banner'); removeDOMElement(paywall); }); From 9e43913e6481dddd7a176987a4334ad91b50195e Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Sat, 16 Nov 2019 22:57:23 +0100 Subject: [PATCH 4/6] Fix Ad.nl/Ed.nl (cookie) Fix for new cookie-scheme (drop specific cookie). --- background.js | 6 ++++++ contentScript.js | 14 ++++++-------- manifest.json | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/background.js b/background.js index 177f3ab..4e99b39 100644 --- a/background.js +++ b/background.js @@ -181,6 +181,12 @@ const remove_cookies_select_hold = { // select only specific cookie(s) to drop from remove_cookies domains const remove_cookies_select_drop = { + '.ad.nl': ['temptationTrackingId'], + '.www.ad.nl': ['none'], + 'www.ad.nl': ['none'], + '.ed.nl': ['temptationTrackingId'], + '.www.ed.nl': ['none'], + 'www.ed.nl': ['none'], 'www.nrc.nl': ['counter'] } diff --git a/contentScript.js b/contentScript.js index 5312c80..168111a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -115,8 +115,9 @@ if (window.location.href.indexOf("bloombergquint.com") !== -1) { if (window.location.href.indexOf("bloomberg.com") !== -1) { document.addEventListener('DOMContentLoaded', () => { const fence = document.querySelector('.fence-body'); - if (fence) + if (fence){ fence.classList.remove('fence-body'); + } const paywall = document.getElementById('paywall-banner'); removeDOMElement(paywall); }); @@ -128,15 +129,12 @@ if (window.location.href.indexOf('telegraaf.nl') !== -1) { if (paywall) { window.location.reload(true); } - }, 500); // Delay (in milliseconds) + }, 1000); // Delay (in milliseconds) } -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; - } +if (window.location.href.indexOf('ad.nl') !== -1 || window.location.href.indexOf('ed.nl') !== -1) { + let paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); + removeDOMElement(paywall); } if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { diff --git a/manifest.json b/manifest.json index 6ab2933..3b3cd6d 100644 --- a/manifest.json +++ b/manifest.json @@ -9,6 +9,7 @@ "*://*.bloomberg.com/*", "*://*.businessinsider.com/*", "*://*.caixinglobal.com/*", + "*://*.ad.nl/*", "*://*.ed.nl/*", "*://*.haaretz.co.il/*", "*://*.lemonde.fr/*", From cbdcbe81f524646302e60e40931e592dbc87e9c0 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Sun, 17 Nov 2019 17:06:30 +0100 Subject: [PATCH 5/6] Add DeMorgen.be Already in Chrome version of extension. --- README.md | 1 + background.js | 5 +++++ manifest.json | 3 ++- options.js | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2f5043..da0c1fa 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ [Crain's Chicago Business](https://www.chicagobusiness.com)\ [Corriere Della Sera](https://www.corriere.it)\ [Daily Press](https://www.dailypress.com)\ +[DeMorgen](https://demorgen.be)\ [Denver Post](https://www.denverpost.com)\ [De Groene Amsterdammer](https://www.groene.nl)\ [De Tijd](https://www.tijd.be)\ diff --git a/background.js b/background.js index 4e99b39..e3e473d 100644 --- a/background.js +++ b/background.js @@ -14,6 +14,7 @@ var defaultSites = { 'Crain\'s Chicago Business': 'chicagobusiness.com', 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', + 'DeMorgen': 'demorgen.be', 'Denver Post': 'denverpost.com', 'De Tijd': 'tijd.be', 'De Groene Amsterdammer': 'groene.nl', @@ -101,6 +102,7 @@ const allow_cookies = [ 'bostonglobe.com', 'cen.acs.org', 'chicagobusiness.com', +'demorgen.be', 'denverpost.com', 'economist.com', 'ed.nl', @@ -142,6 +144,7 @@ const remove_cookies = [ 'bostonglobe.com', 'cen.acs.org', 'chicagobusiness.com', +'demorgen.be', 'denverpost.com', 'economist.com', 'ed.nl', @@ -184,6 +187,8 @@ const remove_cookies_select_drop = { '.ad.nl': ['temptationTrackingId'], '.www.ad.nl': ['none'], 'www.ad.nl': ['none'], + '.demorgen.be': ['TID_ID'], + 'www.demorgen.be': ['none'], '.ed.nl': ['temptationTrackingId'], '.www.ed.nl': ['none'], 'www.ed.nl': ['none'], diff --git a/manifest.json b/manifest.json index 3b3cd6d..93694bf 100644 --- a/manifest.json +++ b/manifest.json @@ -143,7 +143,8 @@ "*://*.vn.nl/*", "*://*.lemonde.fr/*", "*://*.scientificamerican.com/*", - "*://*.thehindu.com/*" + "*://*.thehindu.com/*", + "*://*.demorgen.be/*" ], "version": "1.6.0" } diff --git a/options.js b/options.js index fbb3d3d..5f40578 100644 --- a/options.js +++ b/options.js @@ -12,6 +12,7 @@ var defaultSites = { 'Crain\'s Chicago Business': 'chicagobusiness.com', 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', + 'DeMorgen': 'demorgen.be', 'Denver Post': 'denverpost.com', 'De Groene Amsterdammer': 'groene.nl', 'De Tijd': 'tijd.be', From ede7f1e0e50c5d5e2639da2f0e91bad89ecee986 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Sun, 17 Nov 2019 20:26:29 +0100 Subject: [PATCH 6/6] Simplify specific cookie drop/hold Search for specific cookiename in all available cookie-(sub)domains. --- background.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/background.js b/background.js index e3e473d..a8d5178 100644 --- a/background.js +++ b/background.js @@ -177,22 +177,17 @@ const remove_cookies = [ // 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'] + '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 = { - '.ad.nl': ['temptationTrackingId'], - '.www.ad.nl': ['none'], - 'www.ad.nl': ['none'], - '.demorgen.be': ['TID_ID'], - 'www.demorgen.be': ['none'], - '.ed.nl': ['temptationTrackingId'], - '.www.ed.nl': ['none'], - 'www.ed.nl': ['none'], - 'www.nrc.nl': ['counter'] + 'ad.nl': ['temptationTrackingId'], + 'demorgen.be': ['TID_ID'], + 'ed.nl': ['temptationTrackingId'], + 'nrc.nl': ['counter'] } // Override User-Agent with Googlebot @@ -415,12 +410,13 @@ browser.webRequest.onCompleted.addListener(function(details) { } var cookie_domain = cookies[i].domain; + var rc_domain = cookie_domain.replace(/^(\.?www\.|\.)/, ''); // hold specific cookie(s) from remove_cookies domains - if ((cookie_domain in remove_cookies_select_hold) && remove_cookies_select_hold[cookie_domain].includes(cookies[i].name)){ + if ((rc_domain in remove_cookies_select_hold) && remove_cookies_select_hold[rc_domain].includes(cookies[i].name)){ continue; // don't remove specific cookie } // drop only specific cookie(s) from remove_cookies domains - if ((cookie_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[cookie_domain].includes(cookies[i].name))){ + if ((rc_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[rc_domain].includes(cookies[i].name))){ continue; // only remove specific cookie }