[PATCH] fix themarker/haaretz user agent

This commit is contained in:
Alon Nachshon 2023-03-13 12:34:48 +02:00
parent 3c737d3f4b
commit 416bf48643

View File

@ -160,7 +160,7 @@ const useGoogleBotSites = [
// Override User-Agent with Bingbot // Override User-Agent with Bingbot
const useBingBot = []; const useBingBot = [];
const useGoogleAdsBotMobile = [ const useMsnBot = [
'haaretz.co.il', 'haaretz.co.il',
'haaretz.com', 'haaretz.com',
'themarker.com' 'themarker.com'
@ -235,7 +235,7 @@ const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.go
const userAgentMobile = 'Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)'; const userAgentMobile = 'Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)';
const userAgentDesktopBingBot = 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'; const userAgentDesktopBingBot = 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)';
const userAgentMobileBingBot = 'Chrome/80.0.3987.92 Mobile Safari/537.36 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'; const userAgentMobileBingBot = 'Chrome/80.0.3987.92 Mobile Safari/537.36 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)';
const userAgentGoogleAdsBotMobile = 'Mozilla/5.0 (Linux; Android 5.0; SM-G920A) AppleWebKit (KHTML, like Gecko) Chrome Mobile Safari (compatible; AdsBot-Google-Mobile; +http://www.google.com/mobile/adsbot.html)'; const userAgentMsnBot = 'msnbot/2.0b (+http://search.msn.com/msnbot.htm)';
let enabledSites = []; let enabledSites = [];
@ -425,10 +425,10 @@ extensionApi.webRequest.onBeforeSendHeaders.addListener(function (details) {
} }
// override User-Agent to use Google AdsBot Mobile Web // override User-Agent to use Google AdsBot Mobile Web
if (matchUrlDomain(useGoogleAdsBotMobile, details.url)) { if (matchUrlDomain(useMsnBot, details.url)) {
requestHeaders.push({ requestHeaders.push({
name: 'User-Agent', name: 'User-Agent',
value: userAgentGoogleAdsBotMobile value: userAgentMsnBot
}); });
} }