Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parse Chrome instead of Android as browser #1575

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading