Skip to content

Commit

Permalink
fix: parse Chrome instead of Android as browser (#1575)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Dec 3, 2024
1 parent b3b6ef6 commit 4d705fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/__tests__/utils/event-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ describe(`event-utils`, () => {
expectedBrowser: 'Android Mobile',
},
{
name: 'Android Browser on Galaxy S3',
name: 'Chrome Browser on Galaxy S3',
userAgent:
'Mozilla/5.0 (Linux; Android 4.4.4; en-us; SAMSUNG GT-I9300I Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36',
expectedVersion: 4.4,
expectedBrowser: 'Android Mobile',
expectedVersion: 28.0,
expectedBrowser: 'Chrome',
},
]

Expand Down
4 changes: 2 additions & 2 deletions src/utils/user-agent-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ export const detectBrowser = function (user_agent: string, vendor: string | unde
return CHROME_IOS // why not just Chrome?
} else if (includes(user_agent, 'CrMo')) {
return CHROME
} else if (includes(user_agent, ANDROID) && includes(user_agent, SAFARI)) {
return ANDROID_MOBILE
} else if (includes(user_agent, CHROME)) {
return CHROME
} else if (includes(user_agent, ANDROID) && includes(user_agent, SAFARI)) {
return ANDROID_MOBILE
} else if (includes(user_agent, 'FxiOS')) {
return FIREFOX_IOS
} else if (includes(user_agent.toLowerCase(), KONQUEROR.toLowerCase())) {
Expand Down

0 comments on commit 4d705fd

Please sign in to comment.