From 6b8bf3e87ffd68f4423d043c4af979c887b703a4 Mon Sep 17 00:00:00 2001
From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com>
Date: Sat, 14 Oct 2023 10:21:20 +0200
Subject: [PATCH] Add LePoint.fr
---
README.md | 1 +
background.js | 2 +-
changelog.txt | 1 +
contentScript.js | 71 ++++++++++++++++++++++++++++++++++++++--
custom/manifest.json | 2 +-
custom/sites_custom.json | 8 +----
manifest.json | 3 +-
sites.js | 8 ++++-
sites_updated.json | 7 ++++
9 files changed, 89 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index c3dd2de..f3853ea 100644
--- a/README.md
+++ b/README.md
@@ -500,6 +500,7 @@ Grouped in options:\
[Le Journal du Net](https://www.journaldunet.com) -
[Le Nouvel Economiste](https://www.lenouveleconomiste.fr) -
[Le Parisien](https://www.leparisien.fr) -
+[Le Point](https://www.lepoint.fr) -
[Le Télégramme](https://www.letelegramme.fr) -
[Les Échos](https://www.lesechos.fr) -
[Les Inrockuptibles](https://www.lesinrocks.com) -
diff --git a/background.js b/background.js
index c0a1ca6..a0b1ed0 100644
--- a/background.js
+++ b/background.js
@@ -374,7 +374,7 @@ function set_rules(sites, sites_updated, sites_custom) {
if (!custom) {
let isCustomSite = matchDomain(customSites_domains, domain);
let customSite_title = isCustomSite ? Object.keys(customSites).find(key => customSites[key].domain === isCustomSite) : '';
- if (customSite_title && !(rule.add_ext_link || customSitesExt_remove.includes(isCustomSite))) {
+ if (customSite_title && !(sites_custom[customSite_title].add_ext_link || customSitesExt_remove.includes(isCustomSite))) {
// add default block_regex
let block_regex_default = '';
if (rule.hasOwnProperty('block_regex'))
diff --git a/changelog.txt b/changelog.txt
index 6d52d92..840fddd 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases
Post-release
+Add LePoint.fr
Add Mz.de & Volksstimme.de
Remove Mediahuis Nederland Regional (fix obsolete)
Fix Belfast Telegraph/Independent.ie (images)
diff --git a/contentScript.js b/contentScript.js
index 95aa2e2..3dc020e 100644
--- a/contentScript.js
+++ b/contentScript.js
@@ -314,13 +314,18 @@ if (ext_api.runtime) {
window.addEventListener('message', function (event) {
if (event.data) {
if (event.data.type === 'from_page') {
- if (matchDomain('businesspost.ie')) {
+ if (domain = matchDomain(['businesspost.ie', 'lepoint.fr'])) {
+ let article_options = {
+ 'businesspost.ie': 'div.article-body-section',
+ 'lepoint.fr': 'div#contenu'
+ };
+ let article_sel = article_options[domain];
let data = event.data.data;
- let article = document.querySelector('div.article-body-section');
+ let article = document.querySelector(article_sel);
if (data && article && dompurify_loaded && !msg_once) {
msg_once = true;
let parser = new DOMParser();
- let doc = parser.parseFromString('
' + DOMPurify.sanitize(data) + '
', 'text/html');
+ let doc = parser.parseFromString('' + DOMPurify.sanitize(data, {ADD_TAGS: ['iframe'], ADD_ATTR: ['frameborder']}) + '
', 'text/html');
let article_new = doc.querySelector('div');
if (article_new) {
article.innerHTML = '';
@@ -1860,6 +1865,66 @@ else if (matchDomain('leparisien.fr')) {
}
}
+else if (matchDomain('lepoint.fr')) {
+ function lepoint_main() {
+ function decryptVariable(a) {
+ var t = ["point", "les", "payants", "top"],
+ n = ["le", "avec", "articles", "c"],
+ o = (function () {
+ var o = [];
+ for (var e = 0; e < 4; e++)
+ o.push(n[e]), o.push(t[e]);
+ return o
+ })(),
+ e = {
+ stringify: function (o) {
+ var e = {
+ ct: o.ciphertext.toString(CryptoJS.enc.Base64)
+ };
+ return o.iv && (e.iv = o.iv.toString()),
+ o.salt && (e.s = o.salt.toString()),
+ JSON.stringify(e)
+ },
+ parse: function (o) {
+ var e = JSON.parse(o),
+ t = CryptoJS.lib.CipherParams.create({
+ ciphertext: CryptoJS.enc.Base64.parse(e.ct)
+ });
+ return e.iv && (t.iv = CryptoJS.enc.Hex.parse(e.iv)),
+ e.s && (t.salt = CryptoJS.enc.Hex.parse(e.s)),
+ t
+ }
+ };
+ return JSON.parse(CryptoJS.AES.decrypt(JSON.stringify(a), o.join(" "), {
+ format: e
+ }).toString(CryptoJS.enc.Utf8))
+ }
+ let article = document.querySelector('div#contenu');
+ if (article && window.variable_article_poool)
+ window.postMessage({type: 'from_page', data: decryptVariable(window.variable_article_poool)});
+ }
+ if (!matchDomain(['journal.lepoint.fr'])) {
+ let paywall = document.querySelectorAll('aside.paywall');
+ if (paywall.length) {
+ removeDOMElement(...paywall);
+ insert_script(lepoint_main);
+ }
+ window.setTimeout(function () {
+ let ads = document.querySelectorAll('div[id*="WRAP_"], div#StickyPaywall, div#paywall-sticky, div.slotpub, div.sticky-block');
+ hideDOMElement(...ads);
+ }, 1000);
+ } else {
+ let url = window.location.href;
+ let paywall = document.querySelectorAll('div.accnt-cmp');
+ if (paywall.length) {
+ removeDOMElement(...paywall);
+ let article = document.querySelector('article > section');
+ if (article)
+ article.firstChild.before(archiveLink(url));
+ }
+ }
+}
+
else if (matchDomain('lesechos.fr')) {
if (window.location.pathname.startsWith('/amp/')) {
ampToHtml();
diff --git a/custom/manifest.json b/custom/manifest.json
index 771750d..9361323 100644
--- a/custom/manifest.json
+++ b/custom/manifest.json
@@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
- "version": "3.3.7.7"
+ "version": "3.3.7.8"
}
diff --git a/custom/sites_custom.json b/custom/sites_custom.json
index 368c5c2..206e962 100644
--- a/custom/sites_custom.json
+++ b/custom/sites_custom.json
@@ -1,6 +1,6 @@
{
"###_remove_sites": {
- "cs_code": "africaintelligence.fr, arkansasonline.com, bild.de, columbian.com, intelligenceonline.com, intelligenceonline.fr, interestingengineering.com, jeuneafrique.com, lalettrea.fr, lastampa.it, lavozdegalicia.es, law360.com, manager-magazin.de, ouest-france.fr, repubblica.it, risk.net, saechsische.de, swarajyamag.com, thetexan.news, theweek.com, vikatan.com",
+ "cs_code": "africaintelligence.fr, arkansasonline.com, bild.de, columbian.com, intelligenceonline.com, intelligenceonline.fr, interestingengineering.com, jeuneafrique.com, lalettrea.fr, lastampa.it, lavozdegalicia.es, law360.com, lepoint.fr, manager-magazin.de, ouest-france.fr, repubblica.it, risk.net, saechsische.de, swarajyamag.com, thetexan.news, theweek.com, vikatan.com",
"domain": "###"
},
"Abajournal.com": {
@@ -337,12 +337,6 @@
"allow_cookies": 1,
"domain": "lemonde.fr"
},
- "Lepoint.fr": {
- "add_ext_link": "div.info-paywall|div.ArticleBody>p",
- "add_ext_link_type": "archive.is",
- "allow_cookies": 1,
- "domain": "lepoint.fr"
- },
"Libraryjournal.com": {
"allow_cookies": 1,
"block_regex": "\\.libraryjournal.com\\.com\\/.+\\/js\\/metering\\.js",
diff --git a/manifest.json b/manifest.json
index efd256c..4219b66 100644
--- a/manifest.json
+++ b/manifest.json
@@ -409,6 +409,7 @@
"*://*.lenouveleconomiste.fr/*",
"*://*.lenouvelliste.ch/*",
"*://*.leparisien.fr/*",
+ "*://*.lepoint.fr/*",
"*://*.leprogres.fr/*",
"*://*.lescienze.it/*",
"*://*.lesechos.fr/*",
@@ -799,5 +800,5 @@
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
- "version": "3.3.7.7"
+ "version": "3.3.7.8"
}
diff --git a/sites.js b/sites.js
index 1a6c990..02d87fd 100644
--- a/sites.js
+++ b/sites.js
@@ -1324,6 +1324,12 @@ var defaultSites = {
block_regex: /\.tinypass\.com\//,
useragent: "googlebot"
},
+ "Le Point": {
+ domain: "lepoint.fr",
+ allow_cookies: 1,
+ block_regex: /\.poool\.fr\//,
+ cs_dompurify: 1
+ },
"Le Télégramme": {
domain: "letelegramme.fr",
allow_cookies: 1,
@@ -2772,4 +2778,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', 'compactmag.com', 'courrierinternational.com', 'deutsche-wirtschafts-nachrichten.de', 'diepresse.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'finance.si', 'ftchinese.com', 'gamestar.de', 'geo.de', 'golem.de', 'handelsblatt.com', 'hbrchina.org', 'heise.de', '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', 'lepoint.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', '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', 'welt.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', 'compactmag.com', 'courrierinternational.com', 'deutsche-wirtschafts-nachrichten.de', 'diepresse.com', 'dn.no', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'finance.si', 'ftchinese.com', 'gamestar.de', 'geo.de', 'golem.de', 'handelsblatt.com', 'hbrchina.org', 'heise.de', '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', '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', 'welt.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 780cc1a..5abe058 100644
--- a/sites_updated.json
+++ b/sites_updated.json
@@ -57,6 +57,13 @@
"ld_json_url": "div.paywall-teaser-box|div.elementor-widget-container > p",
"upd_version": "3.3.6.8"
},
+ "Le Point": {
+ "domain": "lepoint.fr",
+ "allow_cookies": 1,
+ "block_regex": "\\.poool\\.fr",
+ "ld_google_webcache": "aside.paywall|div#contenu",
+ "upd_version": "3.3.7.8"
+ },
"Mexico News Daily": {
"domain": "mexiconewsdaily.com",
"allow_cookies": 1,