diff --git a/README.md b/README.md index dcbdc5cf..908ebad7 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,14 @@ Groupe EBRA sites (grouped in options) like [Le Progrès](https://www.leprogres.fr) - [Le Républicain Lorrain](https://www.republicain-lorrain.fr) - [Vosges Matin](https://www.vosgesmatin.fr) +Groupe La Dépêche sites (grouped in options) like +[Centre Presse](https://www.centrepresseaveyron.fr) – +[L'Indépendant](https://www.lindependant.fr) - +[La Dépêche du Midi](https://www.ladepeche.fr) – +[La Nouvelle République des Pyrénées](https://www.nrpyrenees.fr) - +[Le Petit Bleu d'Agen](https://www.petitbleu.fr) - +[Midi Libre](https://www.midilibre.fr) - +[Midi Olympique](https://www.midi-olympique.fr) Groupe Rossel sites (grouped in options) like [L'Aisne nouvelle](https://www.aisnenouvelle.fr) - [L'Ardennais](https://www.lardennais.fr) - @@ -196,7 +204,6 @@ Groupe Rossel sites (grouped in options) like [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) – [Le Journal du Dimanche](https://lejdd.fr) – [Le Journal du Net](https://www.journaldunet.com) - [Le Parisien](https://www.leparisien.fr) - diff --git a/background.js b/background.js index 5f0e66d7..c0f8e867 100644 --- a/background.js +++ b/background.js @@ -225,7 +225,6 @@ var blockedRegexes = { 'knack.be': /.+\.knack\.be\/js\/responsive\/rmgModal\.js/, 'kurier.at': /cdn\.tinypass\.com\/.+/, 'la-croix.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/, - 'ladepeche.fr': /.+\.poool\.fr\/.+/, 'lasegunda.com': /\.(lasegunda\.com|emol\.cl)\/.+\/js\/((vendor\/)?modal|merPramV\d|PramModal\.min)\.js/, 'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/, 'latercera.com': /(.+\.latercera\.com\/arc\/subs\/p\.js|cdn\.cxense\.com\/.+)/, @@ -292,6 +291,7 @@ const es_grupo_vocento_domains = ['diariosur.es', 'diariovasco.com', 'elcomercio 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 fr_groupe_ebra_domains = ['bienpublic.com', 'dna.fr', 'estrepublicain.fr', 'lalsace.fr', 'ledauphine.com', 'lejsl.com', 'leprogres.fr', 'republicain-lorrain.fr', 'vosgesmatin.fr']; +const fr_groupe_la_depeche_domains = ['centrepresseaveyron.fr', 'ladepeche.fr', 'lindependant.fr', 'midi-olympique.fr', 'midilibre.fr', 'nrpyrenees.fr', 'petitbleu.fr']; 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 @@ -306,7 +306,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, fr_be_groupe_rossel_domains, fr_groupe_ebra_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, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, ilmessaggero_domains, nymag_domains); var customSites = {}; var customSites_domains = []; @@ -341,8 +341,32 @@ ext_api.storage.sync.get({ } }); +var grouped_sites = { +'ad.nl': ad_region_domains, +'###_au_comm_media': au_comm_media_domains, +'###_au_news_corp': au_news_corp_domains, +'###_au_prov_news': au_prov_news_domains, +'###_es_grupo_vocento': es_grupo_vocento_domains, +'###_fi_alma_talent': fi_alma_talent_domains, +'###_fr_be_groupe_rossel': fr_be_groupe_rossel_domains, +'###_fr_groupe_ebra': fr_groupe_ebra_domains, +'###_fr_groupe_la_depeche': fr_groupe_la_depeche_domains, +'ilmessaggero.it': ilmessaggero_domains, +'nymag.com': nymag_domains +}; + +function add_grouped__enabled_domains(groups) { + for (let key in groups) { + if (enabledSites.includes(key)) + enabledSites = enabledSites.concat(groups[key]); + else + disabledSites = disabledSites.concat(groups[key]); + } +} + // add grouped sites to en/disabledSites & init rules (optional) function add_grouped_sites(init_rules) { + add_grouped__enabled_domains(grouped_sites); if (init_rules) { for (let domain of ad_region_domains) remove_cookies_select_drop[domain] = ['temptationTrackingId']; @@ -367,62 +391,27 @@ function add_grouped_sites(init_rules) { use_google_bot.push(domain); } for (let domain of fr_be_groupe_rossel_domains) { - if (['paris-normandie.fr'].includes(domain)) + if (['paris-normandie.fr'].includes(domain)) { + allow_cookies.push(domain); blockedRegexes[domain] = /.+\.poool\.fr\/.+/; - else if (!['lecho.be'].includes(domain)) { + } else if (!['lecho.be'].includes(domain)) { allow_cookies.push(domain); use_google_bot.push(domain); } } for (let domain of fr_groupe_ebra_domains) { allow_cookies.push(domain); - blockedRegexes[domain] = /(.+\.poool\.fr\/.+|cdn\.ampproject\.org\/v\d\/amp-(access|iframe)-.+\.js)/; + blockedRegexes[domain] = /(.+\.poool\.fr\/.+|cdn\.ampproject\.org\/v\d\/amp-(access|consent|iframe)-.+\.js)/; + } + for (let domain of fr_groupe_la_depeche_domains) { + allow_cookies.push(domain); + blockedRegexes[domain] = /(.+\.poool\.fr\/.+|cdn\.ampproject\.org\/v\d\/amp-(access|consent)-.+\.js)/;//|iframe } for (let domain of ilmessaggero_domains) blockedRegexes[domain] = /utils\.cedsdigital\.it\/js\/PaywallMeter\.js/; for (let domain of pg_domains) remove_cookies_select_drop[domain] = ['TID_ID']; } - if (enabledSites.includes('ad.nl')) - enabledSites = enabledSites.concat(ad_region_domains); - else - disabledSites = disabledSites.concat(ad_region_domains); - if (enabledSites.includes('###_au_comm_media')) - enabledSites = enabledSites.concat(au_comm_media_domains); - else - disabledSites = disabledSites.concat(au_comm_media_domains); - if (enabledSites.includes('###_au_news_corp')) - enabledSites = enabledSites.concat(au_news_corp_domains); - else - disabledSites = disabledSites.concat(au_news_corp_domains); - if (enabledSites.includes('###_au_prov_news')) - enabledSites = enabledSites.concat(au_prov_news_domains); - else - disabledSites = disabledSites.concat(au_prov_news_domains); - if (enabledSites.includes('###_es_grupo_vocento')) - enabledSites = enabledSites.concat(es_grupo_vocento_domains); - else - disabledSites = disabledSites.concat(es_grupo_vocento_domains); - if (enabledSites.includes('###_fi_alma_talent')) - 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('###_fr_groupe_ebra')) - enabledSites = enabledSites.concat(fr_groupe_ebra_domains); - else - disabledSites = disabledSites.concat(fr_groupe_ebra_domains); - if (enabledSites.includes('ilmessaggero.it')) - enabledSites = enabledSites.concat(ilmessaggero_domains); - else - disabledSites = disabledSites.concat(ilmessaggero_domains); - if (enabledSites.includes('nymag.com')) - enabledSites = enabledSites.concat(nymag_domains); - else - disabledSites = disabledSites.concat(nymag_domains); } // Get the enabled sites (from local storage) & add to allow/remove_cookies (if not already in one of these arrays) @@ -738,11 +727,12 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let au_swm_site = (header_referer && urlHost(header_referer).endsWith('com.au') && details.url.includes('https://s.thewest.com.au/')); let es_grupo_vocento_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(es_grupo_vocento_domains, header_referer) && isSiteEnabled({url: header_referer})); let fr_groupe_ebra_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(fr_groupe_ebra_domains, header_referer) && isSiteEnabled({url: header_referer})); + let fr_groupe_la_depeche_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(fr_groupe_la_depeche_domains, header_referer) && isSiteEnabled({url: header_referer})); let fr_lacroix_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('la-croix.com', header_referer) && isSiteEnabled({url: header_referer})); 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 && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !fr_groupe_ebra_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_groupe_ebra_site && !fr_groupe_la_depeche_site && !fr_lacroix_amp_site && !sz_amp_site && !uk_telegraph_amp_site) { return; } diff --git a/changelog.txt b/changelog.txt index 3fd137b9..80da33f0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,12 +3,12 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Groupe EBRA (France) +Add Groupe La Dépêche (France) * v1.9.8.0 (2020-12-06) 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) Remove NK News (obsolete) diff --git a/contentScript.js b/contentScript.js index 3897b17b..8e7036a6 100644 --- a/contentScript.js +++ b/contentScript.js @@ -7,6 +7,7 @@ var csDone = false; var arr_localstorage_hold = ['charliehebdo.fr', 'elmundo.es', 'kurier.at', 'nknews.org', 'nrz.de', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk', 'waz.de', 'wp.de', 'wr.de']; var 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']; var fr_groupe_ebra_domains = ['bienpublic.com', 'dna.fr', 'estrepublicain.fr', 'lalsace.fr', 'ledauphine.com', 'lejsl.com', 'leprogres.fr', 'republicain-lorrain.fr', 'vosgesmatin.fr']; +var fr_groupe_la_depeche_domains = ['centrepresseaveyron.fr', 'ladepeche.fr', 'lindependant.fr', 'midi-olympique.fr', 'midilibre.fr', 'nrpyrenees.fr', 'petitbleu.fr']; arr_localstorage_hold = arr_localstorage_hold.concat(es_grupo_vocento_domains); if (!matchDomain(arr_localstorage_hold)){ window.localStorage.clear(); @@ -81,6 +82,8 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam // Australia News Corp let au_nc_sites = ['adelaidenow.com.au', 'cairnspost.com.au', 'couriermail.com.au', 'dailytelegraph.com.au', 'geelongadvertiser.com.au', 'goldcoastbulletin.com.au', 'heraldsun.com.au', 'ntnews.com.au', 'theaustralian.com.au', 'themercury.com.au', 'townsvillebulletin.com.au', 'weeklytimesnow.com.au']; if (matchDomain(au_nc_sites)) { + let header_ads = document.querySelector('.header_ads-container'); + removeDOMElement(header_ads); if (window.location.hostname.startsWith('amp.')) { let div_hidden_all = document.querySelectorAll('div[amp-access="access AND subscriber"]'); for (let div_hidden of div_hidden_all) @@ -781,19 +784,37 @@ else if (matchDomain("americanaffairsjournal.org")) { removeDOMElement(paywall_bar); } -else if (matchDomain('ladepeche.fr')) { - window.setTimeout(function () { - const hidden_section = document.querySelector('.article-full__body-content'); - if (hidden_section) { - hidden_section.classList.remove('article-full__body-content'); - let pars = hidden_section.querySelectorAll("p, h2, div"); - for (let par of pars) { - par.removeAttribute('style'); +else if (domain = matchDomain(fr_groupe_la_depeche_domains)) { + let url = window.location.href; + let url_new = url.replace(domain + '/', domain + '/amp/'); + if (url.includes(domain + '/amp/')) { + let amp_access_hide = document.querySelector('[amp-access-hide]'); + if (amp_access_hide) { + amp_access_hide.removeAttribute('amp-access-hide'); + } + } else { + if (!['nrpyrenees.fr', 'petitbleu.fr'].includes(domain)) { + window.setTimeout(function () { + const hidden_section = document.querySelector('.article-full__body-content'); + if (hidden_section) { + hidden_section.classList.remove('article-full__body-content'); + let pars = hidden_section.querySelectorAll("p, h2, div"); + for (let par of pars) { + par.removeAttribute('style'); + } + } + const abon = document.querySelector('#noscript-paywall-content, #noscript-paywall'); + removeDOMElement(abon); + }, 500); // Delay (in milliseconds) + } else { + let paywall = document.querySelector('#noscript-paywall-content'); + if (paywall) { + window.setTimeout(function () { + window.location.href = url_new; + }, 500); // Delay (in milliseconds) } } - const abon = document.querySelector('#noscript-paywall-content, #noscript-paywall'); - removeDOMElement(abon); - }, 500); // Delay (in milliseconds) + } } else if (matchDomain('challenges.fr')) { diff --git a/manifest.json b/manifest.json index 40ad604c..218dffad 100644 --- a/manifest.json +++ b/manifest.json @@ -76,6 +76,7 @@ "*://*.canberratimes.com.au/*", "*://*.cen.acs.org/*", "*://*.centralwesterndaily.com.au/*", + "*://*.centrepresseaveyron.fr/*", "*://*.challenges.fr/*", "*://*.charliehebdo.fr/*", "*://*.chicagobusiness.com/*", @@ -188,6 +189,7 @@ "*://*.la-croix.com/*", "*://*.labusinessjournal.com/*", "*://*.ladepeche.fr/*", + "*://*.ladepeche.fr/*", "*://*.lalsace.fr/*", "*://*.lanacion.com.ar/*", "*://*.lardennais.fr/*", @@ -215,6 +217,7 @@ "*://*.liberation-champagne.fr/*", "*://*.liberation.fr/*", "*://*.limesonline.com/*", + "*://*.lindependant.fr/*", "*://*.livemint.com/*", "*://*.loebclassics.com/*", "*://*.lopinion.fr/*", @@ -231,6 +234,8 @@ "*://*.mercurynews.com/*", "*://*.mexiconewsdaily.com/*", "*://*.miamiherald.com/*", + "*://*.midi-olympique.fr/*", + "*://*.midilibre.fr/*", "*://*.mikrobitti.fi/*", "*://*.modernhealthcare.com/*", "*://*.mv-voice.com/*", @@ -250,6 +255,7 @@ "*://*.northerndailyleader.com.au/*", "*://*.northernstar.com.au/*", "*://*.nrc.nl/*", + "*://*.nrpyrenees.fr/*", "*://*.nrz.de/*", "*://*.ntnews.com.au/*", "*://*.nybooks.com/*", @@ -262,6 +268,7 @@ "*://*.paloaltoonline.com/*", "*://*.paris-normandie.fr/*", "*://*.parool.nl/*", + "*://*.petitbleu.fr/*", "*://*.philosophynow.org/*", "*://*.portnews.com.au/*", "*://*.post-gazette.com/*", @@ -388,5 +395,5 @@ "*://*.repstatic.it/*", "*://*.userzoom.com/*" ], - "version": "1.9.8.1" + "version": "1.9.8.2" } \ No newline at end of file diff --git a/sites.js b/sites.js index 0ff135f5..ea4f6e6a 100644 --- a/sites.js +++ b/sites.js @@ -71,6 +71,7 @@ var defaultSites = "Globes": "globes.co.il", "Groene Amsterdammer": "groene.nl", "Groupe EBRA (France)": "###_fr_groupe_ebra", + "Groupe La Dépêche (France)": "###_fr_groupe_la_depeche", "Groupe Rossel (France/Belgium)": "###_fr_be_groupe_rossel", "Grupo Vocento (Spain, regional daily)": "###_es_grupo_vocento", "Haaretz English": "haaretz.com", @@ -96,7 +97,6 @@ var defaultSites = "L'Opinion": "lopinion.fr", "L'Orient-Le Jour": "lorientlejour.com", "La Croix": "la-croix.com", - "La Dépêche": "ladepeche.fr", "La Estrella de Valparaíso": "estrellavalpo.cl", "La Nación": "lanacion.com.ar", "La Repubblica": "repubblica.it",