From 699e481c51a9137840452c1205ab51f2b227ccc8 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 25 Oct 2020 09:17:21 +0100 Subject: [PATCH] Fix-update Persgroep newspapers --- background.js | 13 +++++-------- contentScript.js | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/background.js b/background.js index c704ca2..0dabf04 100644 --- a/background.js +++ b/background.js @@ -31,7 +31,6 @@ var allow_cookies = [ 'business-standard.com', 'clarin.com', 'chronicle.com', - 'demorgen.be', 'df.cl', 'dn.se', 'dvhn.nl', @@ -48,7 +47,6 @@ var allow_cookies = [ 'haaretz.co.il', 'haaretz.com', 'handelsblatt.com', - 'humo.be', 'ilfattoquotidiano.it', 'ilrestodelcarlino.it', 'independent.ie', @@ -71,7 +69,6 @@ var allow_cookies = [ 'nybooks.com', 'nytimes.com', 'nzz.ch', - 'parool.nl', 'quotidiano.net', 'quora.com', 'repubblica.it', @@ -87,9 +84,7 @@ var allow_cookies = [ 'themarker.com', 'thewest.com.au', 'timeshighereducation.com', - 'trouw.nl', 'variety.com', - 'volkskrant.nl', 'washingtonpost.com', 'waz.de', 'worldpoliticsreview.com', @@ -113,6 +108,7 @@ const remove_cookies_select_hold = { // list of regional ad.nl sites const ad_region_domains = ['bd.nl', 'ed.nl', 'tubantia.nl', 'bndestem.nl', 'pzc.nl', 'destentor.nl', 'gelderlander.nl']; +const pg_domains = ["parool.nl", "trouw.nl", "volkskrant.nl", "humo.be", "demorgen.be"]; // select only specific cookie(s) to drop from remove_cookies domains var remove_cookies_select_drop = { @@ -123,10 +119,11 @@ var remove_cookies_select_drop = { 'nrc.nl': ['counter'], 'theatlantic.com': ['articleViews'] } -for (var domainIndex in ad_region_domains) { - let domain = ad_region_domains[domainIndex]; +for (let domain of ad_region_domains) remove_cookies_select_drop[domain] = ['temptationTrackingId']; -} + +for (let domain of pg_domains) + remove_cookies_select_drop[domain] = ['TID_ID']; // Override User-Agent with Googlebot var use_google_bot_default = [ diff --git a/contentScript.js b/contentScript.js index aead46d..ec1b15c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -318,13 +318,13 @@ else if (matchDomain("nzherald.co.nz")) { } else if (matchDomain(["parool.nl", "trouw.nl", "volkskrant.nl", "humo.be", "demorgen.be"])) { - document.addEventListener('DOMContentLoaded', () => { + window.setTimeout(function () { let top_banner = document.querySelector('div[data-temptation-position="PAGE_TOP"]'); - let paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); - let hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); + let paywall = document.querySelector('[data-temptation-position="ARTICLE_BOTTOM"]'); + let hidden_section = document.querySelector('[data-temptation-position="ARTICLE_INLINE"]'); let overlay = document.querySelector('div[data-temptation-position="PAGE_BOTTOM"]'); removeDOMElement(top_banner, paywall, hidden_section, overlay); - }); + }, 500); // Delay (in milliseconds) } else if (matchDomain("firstthings.com")) {