From 3e654de8b7ef3a68588f7fa341c6416bd60c1433 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 14 Dec 2021 17:20:30 +0100 Subject: [PATCH] Add LaLibre.be & LeVif.be --- README.md | 2 ++ background.js | 2 ++ bpc_count_daily_users.js | 46 ++++++++++++++++++++++------------------ changelog.txt | 2 ++ contentScript.js | 2 +- custom/manifest.json | 2 +- manifest.json | 4 +++- sites.js | 18 ++++++++++++---- sites_updated.json | 5 +++++ 9 files changed, 55 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index f0316ce..fc51e90 100755 --- a/README.md +++ b/README.md @@ -341,12 +341,14 @@ Grouped in options:\ [L'Opinion](https://www.lopinion.fr) - [L'Usine Nouvelle](https://www.usinenouvelle.com) - [La Croix](https://www.la-croix.com) - +[La Libre](https://www.lalibre.be) - [La Nouvelle République du Centre-Ouest](https://www.lanouvellerepublique.fr) - [La Tribune](https://www.latribune.fr) - [Le Journal du Dimanche](https://lejdd.fr) - [Le Journal du Net](https://www.journaldunet.com) - [Le Parisien](https://www.leparisien.fr) - [Le Télégramme](https://www.letelegramme.fr) - +[Le Vif](https://www.levif.be) - [Les Échos](https://www.lesechos.fr) - [Marianne](https://www.marianne.net) - [Paris Match](https://www.parismatch.com) - diff --git a/background.js b/background.js index 4f3f1f5..25e947c 100755 --- a/background.js +++ b/background.js @@ -1056,6 +1056,8 @@ function check_update() { }); }) } + }).catch(function (err) { + false; }); } diff --git a/bpc_count_daily_users.js b/bpc_count_daily_users.js index a1102c2..70ea710 100644 --- a/bpc_count_daily_users.js +++ b/bpc_count_daily_users.js @@ -2,27 +2,31 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; // daily users counter function bpc_count_daily_users(dateStr) { - ext_api.storage.local.get({ - daily_users: {}, - }, function (items_local) { - daily_users = items_local.daily_users; - if (daily_users.date !== dateStr) { - daily_users.date = dateStr; - ext_api.storage.local.set({ - daily_users: daily_users - }, function () { - true; - }); - let count_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; - fetch(count_json, {mode: 'no-cors'}); - let count_mobile_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-mobile-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; - let count_desktop_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-desktop-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; - if (window.navigator && window.navigator.userAgent.match(/(mobile|android)/i)) - fetch(count_mobile_json, {mode: 'no-cors'}); - else - fetch(count_desktop_json, {mode: 'no-cors'}); - } - }); + ext_api.storage.local.get({ + daily_users: {}, + }, function (items_local) { + daily_users = items_local.daily_users; + if (daily_users.date !== dateStr) { + daily_users.date = dateStr; + ext_api.storage.local.set({ + daily_users: daily_users + }, function () { + true; + }); + let count_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; + try { + fetch(count_json, {mode: 'no-cors'}); + let count_mobile_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-mobile-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; + let count_desktop_json = 'https://bitbucket.org/bpc_redux/bpc-chrome-desktop-daily-users/downloads/bpc-daily-users-' + dateStr + '.json'; + if (window.navigator && window.navigator.userAgent.match(/(mobile|android)/i)) + fetch(count_mobile_json, {mode: 'no-cors'}); + else + fetch(count_desktop_json, {mode: 'no-cors'}); + } catch (err) { + false; + }; + } + }); } function currentDateStr() { diff --git a/changelog.txt b/changelog.txt index fd7ba12..a8a1e62 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add LaLibre.be +Add LeVif.be Fix Bloomberg (permission block js) * v2.4.7.0 (2021-12-12) diff --git a/contentScript.js b/contentScript.js index 3f65414..3092ce0 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1241,7 +1241,7 @@ else if (matchDomain('ftm.nl')) { removeDOMElement(banner_pp); } -else if (matchDomain('knack.be')) { +else if (matchDomain(['knack.be', 'levif.be'])) { let paywall = document.querySelector('[class$="Paywall"], #paywall-modal-below'); if (paywall) { removeDOMElement(paywall); diff --git a/custom/manifest.json b/custom/manifest.json index 0166308..55f2d06 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -39,5 +39,5 @@ "webRequestBlocking", "" ], - "version": "2.4.7.1" + "version": "2.4.7.2" } diff --git a/manifest.json b/manifest.json index 8fb11b0..6c120de 100755 --- a/manifest.json +++ b/manifest.json @@ -263,6 +263,7 @@ "*://*.la-croix.com/*", "*://*.labusinessjournal.com/*", "*://*.ladepeche.fr/*", + "*://*.lalibre.be/*", "*://*.lalsace.fr/*", "*://*.lanacion.com.ar/*", "*://*.lanazione.it/*", @@ -301,6 +302,7 @@ "*://*.lest-eclair.fr/*", "*://*.letelegramme.fr/*", "*://*.levante-emv.com/*", + "*://*.levif.be/*", "*://*.lexpress.fr/*", "*://*.liberation-champagne.fr/*", "*://*.limesonline.com/*", @@ -575,5 +577,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.7.1" + "version": "2.4.7.2" } diff --git a/sites.js b/sites.js index c3f0bfe..3484ae2 100755 --- a/sites.js +++ b/sites.js @@ -544,7 +544,7 @@ var defaultSites = { domain: "groene.nl", remove_cookies_select_hold: ["accept-cookies", "popunder-hidden"] }, - "Groupe EBRA (France)": { + "Groupe EBRA": { domain: "###_fr_groupe_ebra", group: [ "bienpublic.com", @@ -560,7 +560,7 @@ var defaultSites = { allow_cookies: 1, block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js)/ }, - "Groupe La Dépêche (France)": { + "Groupe La Dépêche": { domain: "###_fr_groupe_la_depeche", group: [ "centrepresseaveyron.fr", @@ -574,7 +574,7 @@ var defaultSites = { allow_cookies: 1, block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent|subscriptions)-.+\.js)/ }, - "Groupe Rossel (France/Belgium)": { + "Groupe Rossel": { domain: "###_fr_be_groupe_rossel", group: [ "aisnenouvelle.fr", @@ -796,6 +796,11 @@ var defaultSites = { domain: "estrellavalpo.cl", block_regex: /(\.mercuriovalpo\.cl\/impresa\/.+\/assets\/(vendor|\d)\.js|pram\.pasedigital\.cl\/API\/User\/Status\?)/ }, + "La Libre.be": { + domain: "lalibre.be", + allow_cookies: 1, + useragent: "googlebot" + }, "La Nación": { domain: "lanacion.com.ar" }, @@ -859,6 +864,11 @@ var defaultSites = { block_regex: /\.tinypass\.com\//, useragent: "googlebot" }, + "Le Vif.be": { + domain: "levif.be", + allow_cookies: 1, + block_regex: /(\.levif\.be\/js\/responsive\/rmg(Modal|Paywall)\.js|\.blueconic\.net\/)/ + }, "Le Scienze": { domain: "lescienze.it", group_rule: "###_gr_it_repubblica_domains" @@ -916,7 +926,7 @@ var defaultSites = { domain: "latimes.com", block_regex: /(metering\.platform\.latimes\.com\/v\d\/meter|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|subscriptions)-.+\.js)/ }, - "Madsack Mediengruppe (Germany)": { + "Madsack Mediengruppe": { domain: "###_de_madsack", group: [ "haz.de", diff --git a/sites_updated.json b/sites_updated.json index 12cddff..34d5d6e 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -39,6 +39,11 @@ "allow_cookies": 1, "block_regex": "\\.internazionale\\.it\\/assets\\/js\\/main\\.\\d{2,}\\.js" }, + "La Libre.be": { + "domain": "lalibre.be", + "allow_cookies": 1, + "useragent": "googlebot" + }, "The (New Orleans) Advocate": { "domain": "###_usa_theadvocate", "group": [