Fix The Australian (option to disable Googlebot; http error 403)

master
magnolia1234 2021-09-26 10:10:19 +02:00
parent 451c9181ab
commit c78c69509a
5 changed files with 17 additions and 2 deletions

View File

@ -959,6 +959,18 @@ ext_api.webRequest.onBeforeRequest.addListener(function (details) {
["blocking"]
);
// theaustralian.com redirect subscribe to amp
ext_api.webRequest.onBeforeRequest.addListener(function (details) {
if (!isSiteEnabled(details)) {
return;
}
var updatedUrl = decodeURIComponent(details.url.split('dest=')[1].split('&')[0]).replace('www.', 'amp.');
return { redirectUrl: updatedUrl };
},
{urls:["*://www.theaustralian.com.au/subscribe/*"], types:["main_frame"]},
["blocking"]
);
// fix nytimes x-frame-options (hidden iframe content)
ext_api.webRequest.onHeadersReceived.addListener(function (details) {
if (!isSiteEnabled(details)) {
@ -1206,6 +1218,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
var setReferer = false;
var googlebotEnabled = matchUrlDomain(use_google_bot, details.url) &&
!(matchUrlDomain('barrons.com', details.url) && enabledSites.includes('#options_disable_gb_barrons')) &&
!(matchUrlDomain('theaustralian.com.au', details.url) && enabledSites.includes('#options_disable_gb_theaustralian')) &&
!(matchUrlDomain('wsj.com', details.url) && enabledSites.includes('#options_disable_gb_wsj'));
if (matchUrlDomain(change_headers, details.url) && (!['font', 'image', 'stylesheet'].includes(details.type) || matchUrlDomain(['thetimes.co.uk'], details.url))) {

View File

@ -8,6 +8,7 @@ Add Tampa Bay Times (local USA)
Fix Challenges.fr (blur)
Fix LesEchos.fr (json)
Fix Repubblica.it & LaStampa.it (videos on Firefox)
Fix The Australian (option to disable Googlebot; http error 403)
Fix WSJ & Barron's (amp)
* v2.3.6.0 (2021-09-05)

View File

@ -39,5 +39,5 @@
"webRequestBlocking",
"<all_urls>"
],
"version": "2.3.6.4"
"version": "2.3.6.5"
}

View File

@ -547,5 +547,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.3.6.4"
"version": "2.3.6.5"
}

View File

@ -317,6 +317,7 @@ var defaultSites =
"Show options on update": "#options_on_update",
"Restore opt-in for custom sites (on reload; Chrome-only)": "#options_restore_custom",
"Barron's - no Googlebot (http error 500)": "#options_disable_gb_barrons",
"The Australian - no Googlebot (http error 403)": "#options_disable_gb_theaustralian",
"The Wall Street Journal - no Googlebot (http error 500)": "#options_disable_gb_wsj"
}