mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
14 lines
373 B
TypeScript
14 lines
373 B
TypeScript
export const detectBrowser = () => {
|
|
if (!navigator) return undefined
|
|
|
|
if (navigator.userAgent.indexOf('Chrome') !== -1) {
|
|
return 'Chrome'
|
|
} else if (navigator.userAgent.indexOf('Firefox') !== -1) {
|
|
return 'Firefox'
|
|
} else if (navigator.userAgent.indexOf('Safari') !== -1) {
|
|
return 'Safari'
|
|
}
|
|
}
|
|
|
|
export const isBrowser = typeof window !== 'undefined'
|