From 320bfe2421ac56df38fef350b09f51eb737e6fff Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 6 Dec 2020 12:43:16 +0100 Subject: [PATCH] Add Groupe Rossel (France/Belgium) --- README.md | 16 +++++++++++++--- background.js | 23 ++++++++++++++++------- changelog.txt | 1 + contentScript.js | 6 +++--- manifest.json | 10 +++++++++- sites.js | 4 +--- 6 files changed, 43 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 82ec024e..b6b92a62 100644 --- a/README.md +++ b/README.md @@ -170,16 +170,26 @@ Alma Talent sites (grouped in options) like [Alternatives Economiques](https://www.alternatives-economiques.fr) - [Challenges](https://www.challenges.fr) – [Charlie Hebdo](https://charliehebdo.fr) - -[Esprit](https://esprit.presse.fr) - +[Esprit](https://esprit.presse.fr) +Groupe Rossel sites like +[L'Aisne nouvelle](https://www.aisnenouvelle.fr) - +[L'Ardennais](https://www.lardennais.fr) - +[L'Est-Éclair](https://www.lest-eclair.fr) - +[L'Union - L'Ardennais](https://www.lunion.fr) - [L'Écho](https://lecho.be) - +[La Voix du Nord](https://www.lavoixdunord.fr) - +[Le Courrier picard](https://www.courrier-picard.fr) - +[Le Soir](https://www.lesoir.be) - +[Libération Champagne](https://www.liberation-champagne.fr) - +[Nord Éclair](https://www.nordeclair.fr) - +[Paris Normandie](https://www.paris-normandie.fr) - +[SudInfo](https://www.sudinfo.be) [L'Opinion](https://www.lopinion.fr) – [La Croix](https://www.la-croix.com) - [La Dépêche](https://www.ladepeche.fr) – -[La Voix du Nord](https://www.lavoixdunord.fr) - [Le Journal du Dimanche](https://lejdd.fr) – [Le Journal du Net](https://www.journaldunet.com) - [Le Parisien](https://www.leparisien.fr) - -[Le Soir](https://plus.lesoir.be) - [Les Échos](https://www.lesechos.fr) - [Libération](https://www.liberation.fr)* – [Science & Vie](https://www.science-et-vie.com) - diff --git a/background.js b/background.js index e08025e8..36ecfcb6 100644 --- a/background.js +++ b/background.js @@ -31,6 +31,7 @@ const restrictions = { var allow_cookies_default = [ 'abc.es', 'belfasttelegraph.co.uk', + 'bloomberg.com', 'bostonglobe.com', 'business-standard.com', 'charliehebdo.fr', @@ -65,11 +66,9 @@ var allow_cookies_default = [ 'knack.be', 'kurier.at', 'la-croix.com', - 'lavoixdunord.fr', 'lc.nl', 'lejdd.fr', 'lesechos.fr', - 'lesoir.be', 'limesonline.com', 'lrb.co.uk', 'modernhealthcare.com', @@ -150,8 +149,6 @@ var use_google_bot_default = [ 'handelsblatt.com', 'hs.fi', 'intelligentinvestor.com.au', - 'lavoixdunord.fr', - 'lesoir.be', 'mexiconewsdaily.com', 'miamiherald.com', 'nzz.ch', @@ -293,6 +290,7 @@ const au_news_corp_domains = ['adelaidenow.com.au', 'cairnspost.com.au', 'courie const au_prov_news_domains = ['news-mail.com.au', 'frasercoastchronicle.com.au', 'gladstoneobserver.com.au', 'dailyexaminer.com.au', 'dailymercury.com.au', 'themorningbulletin.com.au', 'sunshinecoastdaily.com.au', 'gympietimes.com.au', 'northernstar.com.au', 'qt.com.au', 'thechronicle.com.au', 'warwickdailynews.com.au']; const es_grupo_vocento_domains = ['diariosur.es', 'diariovasco.com', 'elcomercio.es', 'elcorreo.com', 'eldiariomontanes.es', 'elnortedecastilla.es', 'hoy.es', 'ideal.es', 'larioja.com', 'laverdad.es', 'lavozdigital.es']; const fi_alma_talent_domains = ['arvopaperi.fi', 'kauppalehti.fi', 'marmai.fi', 'mediuutiset.fi', 'mikrobitti.fi', 'talouselama.fi', 'tekniikkatalous.fi', 'tivi.fi', 'uusisuomi.fi']; +const fr_be_groupe_rossel_domains = ['aisnenouvelle.fr', 'courrier-picard.fr', 'lardennais.fr', 'lavoixdunord.fr', 'lecho.be', 'lesoir.be', 'lest-eclair.fr', 'liberation-champagne.fr', 'lunion.fr', 'nordeclair.fr', 'paris-normandie.fr', 'sudinfo.be']; const ilmessaggero_domains = ['corriereadriatico.it', 'ilgazzettino.it', 'ilmattino.it', 'quotidianodipuglia.it']; const nymag_domains = ['grubstreet.com', 'thecut.com', 'vulture.com']; // pg_domains has only grouped remove_cookies_select_drop rules @@ -307,7 +305,7 @@ const userAgentMobileB = "Chrome/80.0.3987.92 Mobile Safari/537.36 (compatible; var enabledSites = []; var disabledSites = []; var defaultSites_grouped_domains = Object.values(defaultSites); -var defaultSites_domains = defaultSites_grouped_domains.concat(ad_region_domains, au_comm_media_domains, au_news_corp_domains, au_prov_news_domains, es_grupo_vocento_domains, fi_alma_talent_domains, ilmessaggero_domains, nymag_domains); +var defaultSites_domains = defaultSites_grouped_domains.concat(ad_region_domains, au_comm_media_domains, au_news_corp_domains, au_prov_news_domains, es_grupo_vocento_domains, fi_alma_talent_domains, fr_be_groupe_rossel_domains, ilmessaggero_domains, nymag_domains); var customSites = {}; var customSites_domains = []; @@ -367,6 +365,14 @@ function add_grouped_sites(init_rules) { for (let domain of fi_alma_talent_domains) { use_google_bot.push(domain); } + for (let domain of fr_be_groupe_rossel_domains) { + if (['paris-normandie.fr'].includes(domain)) + blockedRegexes[domain] = /.+\.poool\.fr\/.+/; + else if (!['lecho.be'].includes(domain)) { + allow_cookies.push(domain); + use_google_bot.push(domain); + } + } for (let domain of ilmessaggero_domains) blockedRegexes[domain] = /utils\.cedsdigital\.it\/js\/PaywallMeter\.js/; for (let domain of pg_domains) @@ -396,6 +402,10 @@ function add_grouped_sites(init_rules) { enabledSites = enabledSites.concat(fi_alma_talent_domains); else disabledSites = disabledSites.concat(fi_alma_talent_domains); + if (enabledSites.includes('###_fr_be_groupe_rossel')) + enabledSites = enabledSites.concat(fr_be_groupe_rossel_domains); + else + disabledSites = disabledSites.concat(fr_be_groupe_rossel_domains); if (enabledSites.includes('ilmessaggero.it')) enabledSites = enabledSites.concat(ilmessaggero_domains); else @@ -714,7 +724,6 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { } let inkl_site = (matchUrlDomain('cdn.jsdelivr.net', details.url) && matchUrlDomain('inkl.com', header_referer) && isSiteEnabled({url: header_referer})); - let bloomberg_site = (matchUrlDomain('assets.bwbx.io', details.url) && matchUrlDomain('bloomberg.com', header_referer) && isSiteEnabled({url: header_referer})); let au_nc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(au_news_corp_domains, header_referer) && isSiteEnabled({url: header_referer})); let au_apn_site = (header_referer && (urlHost(header_referer).endsWith('com.au') || urlHost(header_referer).endsWith('net.au')) && details.url.includes('https://media.apnarm.net.au/')); let au_swm_site = (header_referer && urlHost(header_referer).endsWith('com.au') && details.url.includes('https://s.thewest.com.au/')); @@ -723,7 +732,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let sz_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('sueddeutsche.de', header_referer) && isSiteEnabled({url: header_referer})); let uk_telegraph_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('telegraph.co.uk', header_referer) && isSiteEnabled({url: header_referer})); - if (!isSiteEnabled(details) && !inkl_site && !bloomberg_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !fr_lacroix_amp_site && !sz_amp_site && !uk_telegraph_amp_site) { + if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !fr_lacroix_amp_site && !sz_amp_site && !uk_telegraph_amp_site) { return; } diff --git a/changelog.txt b/changelog.txt index 559b1746..3976a486 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add El Comercio, Ideal & La Voz de Cadiz (Spain) Add Esprit (France) +Add Groupe Rossel (France/Belgium) Add La Voix du Nord (France) Add The Spectator USA Remove Aftonbladet.se (obsolete) diff --git a/contentScript.js b/contentScript.js index a29e0575..d02277fe 100644 --- a/contentScript.js +++ b/contentScript.js @@ -604,9 +604,9 @@ else if (matchDomain("thestar.com")) { let endnote_html; if (elem.author) { endnote_html = parser.parseFromString('
', 'text/html'); } else endnote_html = parser.parseFromString('' + elem.text + '