From ab42818e13f2b94ebf37fcba66b13872100cc449 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 1 Nov 2023 12:59:09 +0100 Subject: [PATCH] Add LeFigaro.fr & LeMonde.fr (link to archive.is) --- README.md | 2 ++ changelog.txt | 2 ++ contentScript.js | 25 +++++++++++++++++++++++++ custom/manifest.json | 2 +- custom/sites_custom.json | 12 ------------ manifest.json | 4 +++- options/options.js | 2 +- sites.js | 10 +++++++++- sites_updated.json | 15 +++++++++++++++ 9 files changed, 58 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index eb2ea2e..7039b25 100644 --- a/README.md +++ b/README.md @@ -506,9 +506,11 @@ Grouped in options:\ [La Nouvelle République du Centre-Ouest](https://www.lanouvellerepublique.fr) - [La Tribune](https://www.latribune.fr) - [Le Courrier des Stratèges](https://lecourrierdesstrateges.fr) - +[Le Figaro (link to archive.is)](https://www.lefigaro.fr) - [Le Grand Continent](https://legrandcontinent.eu) - [Le Journal du Dimanche](https://lejdd.fr) - [Le Journal du Net](https://www.journaldunet.com) - +[Le Monde (link to archive.is)](https://www.lemonde.fr) - [Le Nouvel Economiste](https://www.lenouveleconomiste.fr) - [Le Parisien](https://www.leparisien.fr) - [Le Point](https://www.lepoint.fr) - diff --git a/changelog.txt b/changelog.txt index 355bd88..90c1d59 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,8 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Add LeFigaro.fr (link to archive.is) +Add LeMonde.fr (link to archive.is) Add The Impression Fix WSJ (mobile & Googlebot for cn/jp subdomain) Update custom sites (link to 1ft.io) diff --git a/contentScript.js b/contentScript.js index d3c87ab..7f4a1c6 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1768,6 +1768,17 @@ else if (matchDomain('lecourrierdesstrateges.fr')) { }, 500); } +else if (matchDomain('lefigaro.fr')) { + let url = window.location.href; + let paywall = document.querySelector('div#fig-premium-paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div.fig-content-body'); + if (article) + article.firstChild.before(archiveLink(url)); + } +} + else if (matchDomain('legrandcontinent.eu')) { let paywall = document.querySelector('body.paywall, body.pw, body.softwall'); if (paywall) @@ -1788,6 +1799,20 @@ else if (matchDomain(['lejdd.fr', 'parismatch.com', 'public.fr'])) { } } +else if (matchDomain('lemonde.fr')) { + let url = window.location.href; + let paywall = document.querySelector('section.paywall'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('article'); + if (article) + article.firstChild.before(archiveLink(url)); + let hide = document.querySelector('section.article__content--restricted-media'); + if (hide) + hide.classList.remove('article__content--restricted-media'); + } +} + else if (matchDomain('leparisien.fr')) { let paywall = document.querySelector('div.paywall'); if (window.location.pathname.startsWith('/amp/')) { diff --git a/custom/manifest.json b/custom/manifest.json index 53d1352..c83b42c 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.0.3" + "version": "3.4.0.4" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 8163adf..1f1477e 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -346,18 +346,6 @@ "block_regex": "\\.lasvegasadvisor\\.com\\/(opt\\/.+|js\\/access\\.min)\\.js", "domain": "lasvegasadvisor.com" }, - "Lefigaro.fr": { - "add_ext_link": "div#fig-premium-paywall|article", - "add_ext_link_type": "archive.is", - "allow_cookies": 1, - "domain": "lefigaro.fr" - }, - "Lemonde.fr": { - "add_ext_link": "section.paywall|article", - "add_ext_link_type": "archive.is", - "allow_cookies": 1, - "domain": "lemonde.fr" - }, "Libraryjournal.com": { "allow_cookies": 1, "block_regex": "\\.libraryjournal.com\\.com\\/.+\\/js\\/metering\\.js", diff --git a/manifest.json b/manifest.json index 6c69b35..35273da 100644 --- a/manifest.json +++ b/manifest.json @@ -404,11 +404,13 @@ "*://*.lecourrierdesstrateges.fr/*", "*://*.ledauphine.com/*", "*://*.ledevoir.com/*", + "*://*.lefigaro.fr/*", "*://*.legrandcontinent.eu/*", "*://*.lehighvalleylive.com/*", "*://*.lejdd.fr/*", "*://*.lejsl.com/*", "*://*.lemagit.fr/*", + "*://*.lemonde.fr/*", "*://*.lenouveleconomiste.fr/*", "*://*.lenouvelliste.ch/*", "*://*.leparisien.fr/*", @@ -808,5 +810,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.0.3" + "version": "3.4.0.4" } diff --git a/options/options.js b/options/options.js index 4991c0f..8e0db65 100644 --- a/options/options.js +++ b/options/options.js @@ -40,7 +40,7 @@ function renderOptions() { var sites_updated = items.sites_updated; var sites_updated_domains_new = Object.values(sites_updated).filter(x => x.domain && !defaultSites_domains.includes(x.domain)).map(x => x.domain); var sites_custom = items.sites_custom; - var sites_custom_domains = Object.values(sites_custom).filter(x => x.domain).map(x => x.domain); + var sites_custom_domains = Object.values(sites_custom).filter(x => x.domain && x.domain !== '###').map(x => x.domain); var perm_origins = sites_custom_domains.concat(sites_updated_domains_new).map(x => '*://*.' + x + '/*'); var perm_custom = document.getElementById('perm-custom'); diff --git a/sites.js b/sites.js index d5e3554..a7ca627 100644 --- a/sites.js +++ b/sites.js @@ -1315,6 +1315,10 @@ var defaultSites = { block_regex: /\.tinypass\.com\//, remove_cookies_select_drop: ["pw6"] }, + "Le Figaro (link to archive.is)": { + domain: "lefigaro.fr", + allow_cookies: 1 + }, "Le Grand Continent": { domain: "legrandcontinent.eu", allow_cookies: 1 @@ -1328,6 +1332,10 @@ var defaultSites = { domain: "journaldunet.com", allow_cookies: 1 }, + "Le Monde (link to archive.is)": { + domain: "lemonde.fr", + allow_cookies: 1 + }, "Le Nouvel Economiste": { domain: "lenouveleconomiste.fr", allow_cookies: 1, @@ -2820,4 +2828,4 @@ var fr_indigo_nofix_domains = ['africaintelligence.com', 'africaintelligence.fr' var it_gedi_nofix_domains = ['gelocal.it', 'huffingtonpost.it', 'ilsecoloxix.it', 'limesonline.com', 'repubblica.it']; var nl_mediahuis_region_nofix_domains = ['gooieneemlander.nl', 'haarlemsdagblad.nl', 'ijmuidercourant.nl', 'leidschdagblad.nl', 'noordhollandsdagblad.nl']; var uk_delinian_nofix_domains = ['insidepandc.com', 'thedeal.com']; -var nofix_sites = ['aamulehti.fi', 'aftenposten.no', 'aftonbladet.se', 'allgaeuer-zeitung.de', 'asiatimes.com', 'autosport.com', 'badische-zeitung.de', 'bild.de', 'bloomberglaw.com', 'bloombergtax.com', 'borsen.dk', 'businessinsider.de', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'codesports.com.au', 'compactmag.com', 'courrierinternational.com', 'deutsche-wirtschafts-nachrichten.de', 'diepresse.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'falter.at', 'finance.si', 'ftchinese.com', 'gamestar.de', 'geo.de', 'golem.de', 'handelsblatt.com', 'hbrchina.org', 'heise.de', 'hln.be', 'hs.fi', 'ilsole24ore.com', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobinmag.com', 'jeuneafrique.com', 'kleinezeitung.at', 'lavie.fr', 'lavozdegalicia.es', 'law360.com', 'le1hebdo.fr', 'leconomiste.com', 'lefigaro.fr', 'lefilmfrancais.com', 'lemonde.fr', 'lequipe.fr', 'lesjours.fr', 'liberation.fr', 'limburger.nl', 'lopinion.fr', 'mainpost.de', 'manager-magazin.de', 'medianama.com', 'mediapart.fr', 'milanofinanza.it', 'mittelbayerische.de', 'monde-diplomatique.fr', 'mondediplo.com', 'moneycontrol.com', 'morningstar.com', 'moz.de', 'nachrichten.at', 'nationaljournal.com', 'nature.com', 'nbr.co.nz', 'newslaundry.com', 'nn.de', 'ouest-france.fr', 'philonomist.com', 'pnp.de', 'politicopro.com', 'politiken.dk', 'pressreader.com', 'publico.pt', 'quillette.com', 'republic.ru', 'rheinpfalz.de', 'risk.net', 'rnz.de', 'saechsische.de', 'springer.com', 'statnews.com', 'stern.de', 'stimme.de', 'straitstimes.com', 'stratfor.com', 'substack.com', 'sueddeutsche.de', 'suedkurier.de', 'swp.de', 'tagesspiegel.de', 'techcrunch.com', 'the-ken.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'vosgesmatin.fr', 'welt.de', 'weltwoche.ch', 'weltwoche.de', 'weser-kurier.de', 'wiwo.de', 'worldpoliticsreview.com', 'ynet.co.il'].concat(fr_indigo_nofix_domains, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains, uk_delinian_nofix_domains); +var nofix_sites = ['aamulehti.fi', 'aftenposten.no', 'aftonbladet.se', 'allgaeuer-zeitung.de', 'asiatimes.com', 'autosport.com', 'badische-zeitung.de', 'bild.de', 'bloomberglaw.com', 'bloombergtax.com', 'borsen.dk', 'businessinsider.de', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'codesports.com.au', 'compactmag.com', 'courrierinternational.com', 'deutsche-wirtschafts-nachrichten.de', 'diepresse.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'falter.at', 'finance.si', 'ftchinese.com', 'gamestar.de', 'geo.de', 'golem.de', 'handelsblatt.com', 'hbrchina.org', 'heise.de', 'hln.be', 'hs.fi', 'ilsole24ore.com', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobinmag.com', 'jeuneafrique.com', 'kleinezeitung.at', 'lavie.fr', 'lavozdegalicia.es', 'law360.com', 'le1hebdo.fr', 'leconomiste.com', 'lefilmfrancais.com', 'lequipe.fr', 'lesjours.fr', 'liberation.fr', 'limburger.nl', 'lopinion.fr', 'mainpost.de', 'manager-magazin.de', 'medianama.com', 'mediapart.fr', 'milanofinanza.it', 'mittelbayerische.de', 'monde-diplomatique.fr', 'mondediplo.com', 'moneycontrol.com', 'morningstar.com', 'moz.de', 'nachrichten.at', 'nationaljournal.com', 'nature.com', 'nbr.co.nz', 'newslaundry.com', 'nn.de', 'ouest-france.fr', 'philonomist.com', 'pnp.de', 'politicopro.com', 'politiken.dk', 'pressreader.com', 'publico.pt', 'quillette.com', 'republic.ru', 'rheinpfalz.de', 'risk.net', 'rnz.de', 'saechsische.de', 'springer.com', 'statnews.com', 'stern.de', 'stimme.de', 'straitstimes.com', 'stratfor.com', 'substack.com', 'sueddeutsche.de', 'suedkurier.de', 'swp.de', 'tagesspiegel.de', 'techcrunch.com', 'the-ken.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'vosgesmatin.fr', 'welt.de', 'weltwoche.ch', 'weltwoche.de', 'weser-kurier.de', 'wiwo.de', 'worldpoliticsreview.com', 'ynet.co.il'].concat(fr_indigo_nofix_domains, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains, uk_delinian_nofix_domains); diff --git a/sites_updated.json b/sites_updated.json index ba3a3b3..69430bb 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -81,6 +81,13 @@ "remove_cookies_select_drop": ["xbc"], "upd_version": "3.3.9.1" }, + "Le Figaro (link to archive.is)": { + "domain": "lefigaro.fr", + "allow_cookies": 1, + "add_ext_link": "div#fig-premium-paywall|div.fig-content-body", + "add_ext_link_type": "archive.is", + "upd_version": "3.4.0.4" + }, "Le Journal de Montréal": { "domain": "journaldemontreal.com", "allow_cookies": 1, @@ -93,6 +100,14 @@ "block_js_inline": "\\.journalde.+\\.com\\/", "upd_version": "3.3.8.5" }, + "Le Monde (link to archive.is)": { + "domain": "lemonde.fr", + "allow_cookies": 1, + "add_ext_link": "section.paywall|article", + "add_ext_link_type": "archive.is", + "cs_code": "[{\"cond\":\"section.article__content--restricted-media\", \"rm_class\":\"article__content--restricted-media\"}]", + "upd_version": "3.4.0.4" + }, "The Baffler": { "domain": "thebaffler.com", "allow_cookies": 1,