From 5c844d94399e78a0380c6d6b6409e9fd1479672b Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 31 Dec 2021 11:50:38 +0100 Subject: [PATCH] Add Groupe Nice-Matin (France) --- README.md | 6 +++++- changelog.txt | 1 + contentScript.js | 19 +++++++++++++++++-- manifest.json | 5 ++++- sites.js | 14 ++++++++++++-- sites_updated.json | 16 ++++++++++++++++ 6 files changed, 55 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2de60f9..b017d69 100644 --- a/README.md +++ b/README.md @@ -359,7 +359,11 @@ Grouped in options:\ [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) +[Midi Olympique](https://www.midi-olympique.fr)\ +*Groupe Nice-Matin* sites like\ +[Monaco-Matin](https://www.monacomatin.mc) - +[Nice-Matin](https://www.nicematin.com) - +[Var-Matin](https://www.varmatin.com)\ *Groupe Rossel* sites like\ [L'Aisne nouvelle](https://www.aisnenouvelle.fr) - [L'Ardennais](https://www.lardennais.fr) - diff --git a/changelog.txt b/changelog.txt index f712866..aa9ea87 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Capital Gazette (local USA) +Add Groupe Nice-Matin (France) Add Il Foglio (Italy) Fix group Tribune Publishing Company (js) Update popup (permission to clear cookies) diff --git a/contentScript.js b/contentScript.js index f4bd7e2..7a0a23c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -14,6 +14,7 @@ var es_unidad_domains = ['elmundo.es', 'expansion.com', 'marca.com']; var fi_alma_talent_domains = ['arvopaperi.fi', 'iltalehti.fi', 'kauppalehti.fi', 'marmai.fi', 'mediuutiset.fi', 'mikrobitti.fi', 'talouselama.fi', 'tekniikkatalous.fi', 'tivi.fi', 'uusisuomi.fi']; 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']; +var fr_groupe_nice_matin_domains = ['monacomatin.mc', 'nicematin.com', 'varmatin.com']; var it_ilmessaggero_domains = ['corriereadriatico.it', 'ilgazzettino.it', 'ilmattino.it', 'ilmessaggero.it', 'quotidianodipuglia.it']; var it_repubblica_domains = ['gelocal.it', 'ilsecoloxix.it', 'italian.tech', 'lanuovasardegna.it', 'lastampa.it', 'repubblica.it']; var it_quotidiano_domains = ['ilgiorno.it', 'ilrestodelcarlino.it', 'iltelegrafolivorno.it', 'lanazione.it', 'quotidiano.net']; @@ -28,7 +29,7 @@ var usa_mng_domains = ['denverpost.com', 'eastbaytimes.com', 'mercurynews.com' var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'businessoffashion.com', 'charliehebdo.fr', 'cmjornal.pt', 'expressnews.com', 'fortune.com', 'houstonchronicle.com', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk'].concat(de_funke_media_domains, es_grupo_vocento_domains, es_unidad_domains, no_nhst_media_domains); +var arr_localstorage_hold = ['allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'businessoffashion.com', 'charliehebdo.fr', 'cmjornal.pt', 'expressnews.com', 'fortune.com', 'houstonchronicle.com', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk'].concat(de_funke_media_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, no_nhst_media_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } @@ -960,7 +961,7 @@ else if (matchDomain('politicaexterior.com')) { else csDone = true; -} else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lesinrocks.com', 'lejsl.com', 'loeildelaphotographie.com', 'marianne.net', 'nouvelobs.com', 'parismatch.com', 'science-et-vie.com'])) {//france +} else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lesinrocks.com', 'lejsl.com', 'loeildelaphotographie.com', 'marianne.net', 'nouvelobs.com', 'parismatch.com', 'science-et-vie.com'].concat(fr_groupe_nice_matin_domains))) {//france if (matchDomain('alternatives-economiques.fr')) { window.setTimeout(function () { @@ -1049,6 +1050,20 @@ else if (domain = matchDomain(fr_groupe_la_depeche_domains)) { } } +else if (domain = matchDomain(fr_groupe_nice_matin_domains)) { + let url = window.location.href; + let url_new = url.replace(domain + '/', domain + '/amp/'); + if (url.includes(domain + '/amp/')) { + amp_unhide_access_hide('="access"', '="NOT access"', 'amp-ad, amp-embed'); + } else { + let paywall = document.querySelector('div#article-teaser'); + if (paywall) + paywall.removeAttribute('id'); + } + let ads = document.querySelectorAll('div[class^="ad-slot-"]'); + removeDOMElement(...ads); +} + else if (matchDomain('journaldunet.com')) { let reg_wall = document.querySelector('.reg_wall'); removeDOMElement(reg_wall); diff --git a/manifest.json b/manifest.json index 8ed3281..6d6e2cf 100644 --- a/manifest.json +++ b/manifest.json @@ -358,6 +358,7 @@ "*://*.mikrobitti.fi/*", "*://*.mlive.com/*", "*://*.modernhealthcare.com/*", + "*://*.monacomatin.mc/*", "*://*.morgenpost.de/*", "*://*.mv-voice.com/*", "*://*.mz.de/*", @@ -376,6 +377,7 @@ "*://*.newsweek.com/*", "*://*.newyorker.com/*", "*://*.niagarafallsreview.ca/*", + "*://*.nicematin.com/*", "*://*.nikkei.com/*", "*://*.nj.com/*", "*://*.nknews.org/*", @@ -539,6 +541,7 @@ "*://*.valeursactuelles.com/*", "*://*.vanityfair.com/*", "*://*.variety.com/*", + "*://*.varmatin.com/*", "*://*.velonews.com/*", "*://*.venturebeat.com/*", "*://*.vn.nl/*", @@ -600,5 +603,5 @@ "*://*.wsj.net/*", "*://*.zephr.com/*" ], - "version": "2.4.9.3" + "version": "2.4.9.4" } diff --git a/sites.js b/sites.js index c84ab8f..1e1fddf 100644 --- a/sites.js +++ b/sites.js @@ -573,7 +573,7 @@ var defaultSites = { "vosgesmatin.fr" ], allow_cookies: 1, - block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js)/ + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/ }, "Groupe La Dépêche": { domain: "###_fr_groupe_la_depeche", @@ -587,7 +587,17 @@ var defaultSites = { "petitbleu.fr" ], allow_cookies: 1, - block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent|subscriptions)-.+\.js)/ + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|subscriptions)-.+\.js)/ + }, + "Groupe Nice-Matin": { + domain: "###_fr_groupe_nice_matin", + group: [ + "monacomatin.mc", + "nicematin.com", + "varmatin.com" + ], + allow_cookies: 1, + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ }, "Groupe Rossel": { domain: "###_fr_be_groupe_rossel", diff --git a/sites_updated.json b/sites_updated.json index 3416569..4193a0e 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -8,6 +8,22 @@ "amp_unhide": 1, "block_regex": "(cdn\\.cxense\\.com\\/|cdn\\.ampproject\\.org\\/v\\d\\/amp-((sticky-)?ad|subscriptions)-.+\\.js)" }, + "Groupe Nice-Matin": { + "domain": "###_fr_groupe_nice_matin", + "group": [ + "monacomatin.mc", + "nicematin.com", + "varmatin.com" + ], + "allow_cookies": 1, + "amp_unhide": 1, + "block_regex": "(\\.poool\\.fr\\/|cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|(sticky-)?ad)-.+\\.js)", + "cs_code": [{ + "cond": "div#article-teaser", + "rm_attrib": "id" + } + ] + }, "Il Foglio": { "domain": "ilfoglio.it", "allow_cookies": 1,