From 2175c904d57b16ce28fbe637931662665da98db0 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 18 May 2023 08:22:47 +0200 Subject: [PATCH] Fix Gruppo SAE.it --- README.md | 9 ++++++--- background.js | 4 ++-- changelog.txt | 1 + contentScript.js | 33 +-------------------------------- contentScript_once.js | 2 ++ custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 13 +++++++------ 8 files changed, 21 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 8d4652a3..fae31fc0 100644 --- a/README.md +++ b/README.md @@ -611,11 +611,10 @@ Grouped in options:\ [Il Fatto Quotidiano](https://www.ilfattoquotidiano.it) - [Il Foglio](https://www.ilfoglio.it) - [Il Manifesto](https://ilmanifesto.it) - -[Il Tirreno](https://www.iltirreno.it) - [Internazionale](https://www.internazionale.it) - [Italia Oggi](https://www.italiaoggi.it) - -[La Gazzetta dello Sport](https://www.gazzetta.it) - -[La Nuova Sardegna](https://www.lanuovasardegna.it) +[La Gazzetta dello Sport](https://www.gazzetta.it) + Grouped in options:\ *Gruppo GEDI.it* sites like\ @@ -635,6 +634,10 @@ Grouped in options:\ [Il Telegrafo Livorno](https://www.iltelegrafolivorno.it) - [La Nazione](https://www.lanazione.it) +*[Gruppo SAE.it](https://www.grupposae.it/i-quotidiani)** sites like\ +[Il Tirreno](https://www.iltirreno.it)* - +[La Nuova Sardegna](https://www.lanuovasardegna.it)* + ##### Netherlands/Flanders [De Limburger](https://www.limburger.nl) - [De Tijd](https://www.tijd.be) - diff --git a/background.js b/background.js index 51c03a09..fcd8baa3 100644 --- a/background.js +++ b/background.js @@ -12,7 +12,7 @@ if (typeof ext_api.action !== 'object') { ext_api.action = ext_api.browserAction; } -const dompurify_sites = ['arcinfo.ch', 'belfasttelegraph.co.uk', 'bloomberg.com', 'cicero.de', 'defector.com', 'ilmanifesto.it', 'iltirreno.it', 'inc42.com', 'independent.ie', 'ipolitics.ca', 'italiaoggi.it', 'jacobin.de', 'lanuovasardegna.it', 'lecourrierdesstrateges.fr', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'sloanreview.mit.edu', 'stratfor.com', 'stylist.co.uk', 'techinasia.com', 'thebulletin.org', 'vn.nl', 'zerohedge.com'].concat(nl_mediahuis_noord_domains, nl_mediahuis_region_domains, no_nhst_media_domains); +const dompurify_sites = ['arcinfo.ch', 'belfasttelegraph.co.uk', 'bloomberg.com', 'cicero.de', 'defector.com', 'ilmanifesto.it', 'inc42.com', 'independent.ie', 'ipolitics.ca', 'italiaoggi.it', 'jacobin.de', 'lecourrierdesstrateges.fr', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'sloanreview.mit.edu', 'stratfor.com', 'stylist.co.uk', 'techinasia.com', 'thebulletin.org', 'vn.nl', 'zerohedge.com'].concat(nl_mediahuis_noord_domains, nl_mediahuis_region_domains, no_nhst_media_domains); var optin_setcookie = false; var optin_update = true; var blocked_referer = false; @@ -428,7 +428,7 @@ ext_api.storage.local.get({ } else { ext_api.management.getSelf(function (result) { if ((result.installType === 'development' || (result.installType !== 'development' && !enabledSites.includes('#options_on_update')))) { - let new_groups = ['###_ar_grupo_clarin', '###_be_groupe_ipm', '###_be_roularta', '###_de_noz_mhn', '###_uk_nat_world']; + let new_groups = ['###_ar_grupo_clarin', '###_be_groupe_ipm', '###_be_roularta', '###_de_noz_mhn', '###_it_gruppo_sae', '###_uk_nat_world']; let open_options = new_groups.some(group => !enabledSites.includes(group) && grouped_sites[group].some(domain => enabledSites.includes(domain) && !customSites_domains.includes(domain))) || (enabledSites.includes('tinypass.com') && !enabledSites.includes('piano.io')); if (open_options) diff --git a/changelog.txt b/changelog.txt index 58fc87f9..1577b10a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Remove (custom) Substack (fix obsolete) +Fix Gruppo SAE.it (free articles only) Fix Tagesspiegel.de (not background/checkpoint) Update custom sites/popup (remove Google Search Tool) diff --git a/contentScript.js b/contentScript.js index b18dcd73..b11513d1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1942,39 +1942,8 @@ else if (matchDomain('ilmanifesto.it')) { }, 1000); } -else if (matchDomain(['iltirreno.it', 'lanuovasardegna.it'])) { +else if (matchDomain(['iltirreno.it', 'lanuovasardegna.it']) || matchDomain(['gazzettadimodena.it', 'gazzettadireggio.it', 'lanuovaferrara.it'])) { if (window.location.pathname.includes('/news/')) { - let paywall = document.querySelector('div.MuiBox-root > h4.MuiTypography-h4'); - if (paywall && dompurify_loaded) { - let article = document.querySelector('div.MuiGrid-root.MuiGrid-grid-sm-7 > div'); - if (article) { - removeDOMElement(paywall.parentNode); - try { - fetch(window.location.href) - .then(response => { - if (response.ok) { - response.text().then(html => { - let parser = new DOMParser(); - let doc = parser.parseFromString(html, 'text/html'); - let json = doc.querySelector('script#__NEXT_DATA__'); - if (json) { - let article_new = JSON.parse(json.text).props.pageProps.article.content; - if (article_new) { - let parser = new DOMParser(); - let doc = parser.parseFromString('