From a2268dfe60b825e42654e1f004d3c3e869396879 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 15 Feb 2023 16:58:28 +0100 Subject: [PATCH] Fix Australia News Corp (no amp-fix) --- background.js | 5 +++-- changelog.txt | 1 + contentScript.js | 2 +- custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/background.js b/background.js index f14556bf..11889d25 100644 --- a/background.js +++ b/background.js @@ -649,7 +649,8 @@ ext_api.webRequest.onBeforeRequest.addListener(function (details) { ); // Australia News Corp redirect subscribe to amp -var au_news_corp_subscr = au_news_corp_domains.filter(domain => !['codesports.com.au', 'goldcoastbulletin.com.au', 'ntnews.com.au', 'thechronicle.com.au', 'weeklytimesnow.com.au'].includes(domain)).map(domain => '*://www.' + domain + '/subscribe/*'); +var au_news_corp_no_amp_fix = ['adelaidenow.com.au', 'codesports.com.au', 'goldcoastbulletin.com.au', 'ntnews.com.au', 'thechronicle.com.au', 'themercury.com.au', 'weeklytimesnow.com.au']; +var au_news_corp_subscr = au_news_corp_domains.filter(domain => !au_news_corp_no_amp_fix.includes(domain)).map(domain => '*://www.' + domain + '/subscribe/*'); ext_api.webRequest.onBeforeRequest.addListener(function (details) { if (!isSiteEnabled(details) || details.url.includes('/digitalprinteditions') || !(details.url.includes('dest=') && details.url.split('dest=')[1].split('&')[0])) { return; @@ -908,7 +909,7 @@ if (matchUrlDomain(change_headers, details.url) && !ignore_types.includes(detail !(matchUrlDomain(es_grupo_vocento_domains, details.url) && mobile) && !(matchUrlDomain('barrons.com', details.url) && enabledSites.includes('#options_disable_gb_barrons')) && !(matchUrlDomain(['economictimes.com', 'economictimes.indiatimes.com'], details.url) && !details.url.split(/\?|#/)[0].endsWith('.cms')) && - !(matchUrlDomain(au_news_corp_domains, details.url) && (details.url.includes('?amp') || enabledSites.includes('#options_disable_gb_au_news_corp'))) && + !(matchUrlDomain(au_news_corp_domains, details.url) && (details.url.includes('?amp') || (!matchUrlDomain(au_news_corp_no_amp_fix, details.url) && enabledSites.includes('#options_disable_gb_au_news_corp')))) && !(matchUrlDomain('uol.com.br', details.url) && !matchUrlDomain('folha.uol.com.br', details.url)) && !(matchUrlDomain('wsj.com', details.url) && (enabledSites.includes('#options_disable_gb_wsj') || !details.url.includes('/articles/'))); var bingbotEnabled = matchUrlDomain(use_bing_bot, details.url) && diff --git a/changelog.txt b/changelog.txt index 5b361f73..fa5539af 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Post-release Add DHnet.be Add TagesAnzeiger.ch (link to archive.is) Remove Finance.si (fix obsolete) +Fix Australia News Corp (no amp-fix) Fix Lc.nl Update block general paywall script (FewCents) diff --git a/contentScript.js b/contentScript.js index fa99ed69..dbb15752 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3764,7 +3764,7 @@ else if (matchDomain('newscientist.com')) { else if (matchDomain('newsday.com')) { if (window.location.pathname.startsWith('/amp/')) { - amp_unhide_access_hide('="AccessLevel = \'Full Content Access\' OR Error = true"', '="AccessLevel = \'Page View Limit\'"'); + amp_unhide_access_hide('="AccessLevel = \'Full Content Access\' OR Error = true"', '="Error != true AND UserState != \'Subscribed\'"'); } } diff --git a/custom/manifest.json b/custom/manifest.json index 8bc808de..a13572c7 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.0.5.2" + "version": "3.0.5.3" } diff --git a/manifest.json b/manifest.json index 6176e8e7..ebea5310 100644 --- a/manifest.json +++ b/manifest.json @@ -735,5 +735,5 @@ "*://*.wallkit.net/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.0.5.2" + "version": "3.0.5.3" } diff --git a/sites.js b/sites.js index 70e05c85..1fc20008 100644 --- a/sites.js +++ b/sites.js @@ -2372,7 +2372,7 @@ var defaultSites = { "Check for update rules at startup": { domain: "#options_optin_update_rules" }, - "Australia News Corp - no Googlebot (blocked)": { + "Australia News Corp - no Googlebot (blocked; only disabled when amp-fix)": { domain: "#options_disable_gb_au_news_corp" }, "Barron's - no Googlebot (http error 500)": {