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 c747260..a8d5178 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', @@ -123,6 +125,7 @@ const allow_cookies = [ 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', +'theatlantic.com', 'theaustralian.com.au', 'thediplomat.com', 'thestar.com', @@ -141,6 +144,7 @@ const remove_cookies = [ 'bostonglobe.com', 'cen.acs.org', 'chicagobusiness.com', +'demorgen.be', 'denverpost.com', 'economist.com', 'ed.nl', @@ -161,6 +165,7 @@ const remove_cookies = [ 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', +'theatlantic.com', 'thediplomat.com', 'thestar.com', 'towardsdatascience.com', @@ -172,14 +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 = { - 'www.nrc.nl': ['counter'] + 'ad.nl': ['temptationTrackingId'], + 'demorgen.be': ['TID_ID'], + 'ed.nl': ['temptationTrackingId'], + 'nrc.nl': ['counter'] } // Override User-Agent with Googlebot @@ -402,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 } diff --git a/contentScript.js b/contentScript.js index b2a0487..5fa414a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -106,24 +106,27 @@ 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); }); } 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); + } + }, 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..93694bf 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/*", @@ -142,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',