Skip to content

Instantly share code, notes, and snippets.

@vanthao03596
Created August 30, 2021 16:09
Show Gist options
  • Save vanthao03596/9ffa9bd1cbc14ba6c5afb2a575bf3421 to your computer and use it in GitHub Desktop.
Save vanthao03596/9ffa9bd1cbc14ba6c5afb2a575bf3421 to your computer and use it in GitHub Desktop.
const { userAgent } = window.navigator
export const isIos = /iPhone|iPad/.test(userAgent)
export const isAndroid = /Android/.test(userAgent)
export const isMobile = isIos || isAndroid
export const isMac = /Mac/.test(userAgent)
export const isDesktopSafari = !isMobile && /Safari/.test(userAgent)
export const isIosApp = /HEY iOS/.test(userAgent)
export const isAndroidApp = /Haystack Android/.test(userAgent)
export const isMobileApp = isIosApp || isAndroidApp
export const isDesktopApp = /HEY.+Electron/.test(userAgent)
@DavidShanks1
Copy link

Hello,

did you manage a way to find coin market cap?

re: https://gist.github.com/Linch1/ede03999f483f2b1d5fcac9e8b312f2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment