Skip to content

Commit

Permalink
[PATCH] fix themarker/haaretz user agent (#1254)
Browse files Browse the repository at this point in the history
* update UA for haaretz, themarker

* remove paywall for fortune.com

* [PATCH] fix themarker/haaretz user agent
  • Loading branch information
InterAl committed Jun 11, 2023
1 parent 5bb7dc1 commit 38027f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const useGoogleBotSites = [
// Override User-Agent with Bingbot
const useBingBot = [];

const useGoogleAdsBotMobile = [
const useMsnBot = [
'haaretz.co.il',
'haaretz.com',
'themarker.com'
Expand Down Expand Up @@ -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 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 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 = [];

Expand Down Expand Up @@ -425,10 +425,10 @@ extensionApi.webRequest.onBeforeSendHeaders.addListener(function (details) {
}

// override User-Agent to use Google AdsBot Mobile Web
if (matchUrlDomain(useGoogleAdsBotMobile, details.url)) {
if (matchUrlDomain(useMsnBot, details.url)) {
requestHeaders.push({
name: 'User-Agent',
value: userAgentGoogleAdsBotMobile
value: userAgentMsnBot
});
}

Expand Down

0 comments on commit 38027f3

Please sign in to comment.