From e412b11b30f787e1d16875132b992f33ff841605 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 26 Oct 2021 18:28:57 +0200 Subject: [PATCH] Fix Repubblica sites (disable Googlebot) --- background.js | 3 --- changelog.txt | 2 +- contentScript.js | 5 ++++- custom/manifest.json | 2 +- manifest.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index 8b86c2a..05635b4 100755 --- a/background.js +++ b/background.js @@ -30,7 +30,6 @@ const restrictions = { 'timesofindia.com': /.+\.timesofindia\.com\/($|toi-plus(\/.+)?|.+\.cms)/, 'nknews.org': /^((?!nknews\.org\/pro\/).)*$/, 'quora.com': /^((?!quora\.com\/search\?q=).)*$/, - 'repubblica.it': /^((?!\/video\.repubblica\.it\/).)*$/, 'seekingalpha.com': /.+\/seekingalpha\.com\/($|(amp\/)?(article|news)\/|samw\/)/, 'statista.com': /^((?!\.statista\.com\/(outlook|study)\/).)*$/, 'techinasia.com': /\.techinasia\.com\/.+/, @@ -637,8 +636,6 @@ function add_grouped_sites(init_rules) { } for (let domain of it_repubblica_domains) { allow_cookies.push(domain); - if (['gelocal.it', 'ilsecoloxix.it', 'repubblica.it'].includes(domain)) - use_google_bot.push(domain); blockedRegexes[domain] = /(scripts\.repubblica\.it\/pw\/pw\.js|cdn\.ampproject\.org\/v\d\/amp-(access|ad|user-notification)-.+\.js)/; } for (let domain of nl_pg_domains) { diff --git a/changelog.txt b/changelog.txt index 83cd133..d3628f8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Fix Repubblica sites (disable Googlebot) Fix Stratfor (forecasts) Fix The Athletic (timing) @@ -18,7 +19,6 @@ Fix Financial Times (amp) Fix Knack.be Fix La Croix (timing) Fix La Stampa (http error 403) -Fix The Athletic Fix The Globe and Mail Fix The New Yorker (homepage) Fix Trouw.nl (timing) diff --git a/contentScript.js b/contentScript.js index 9ca2388..742b11d 100755 --- a/contentScript.js +++ b/contentScript.js @@ -2448,7 +2448,10 @@ else if (matchDomain('stratfor.com')) { if (overview_div) { let data = json.props.pageProps.data; let parser = new DOMParser(); - let doc = parser.parseFromString('
' + DOMPurify.sanitize('

' + data.teaser_body + '

' + data.overview + '

Sections

' ) + '
', 'text/html'); + let data_overview = data.overview; + if (!parseHtmlEntities(data_overview).includes(data.teaser_body)) + data_overview = '

' + data.teaser_body + '

' + data_overview; + let doc = parser.parseFromString('
' + DOMPurify.sanitize(data_overview + '

Sections

') + '
', 'text/html'); let content_new = doc.querySelector('div'); let sections = data.section; for (let section of sections) { diff --git a/custom/manifest.json b/custom/manifest.json index 3b6a7d7..44589c5 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -39,5 +39,5 @@ "webRequestBlocking", "" ], - "version": "2.4.1.1" + "version": "2.4.1.2" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 34d2c32..147f9a9 100755 --- a/manifest.json +++ b/manifest.json @@ -544,5 +544,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.1.1" + "version": "2.4.1.2" } \ No newline at end of file