mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 18:29:09 +00:00
Co-authored-by: Mikael Finstad <finstaden@gmail.com> Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com> Co-authored-by: Murderlon <merlijn@soverin.net> Co-authored-by: Artur Paikin <artur@arturpaikin.com>
15 lines
345 B
TypeScript
15 lines
345 B
TypeScript
/**
|
|
* Checks if current device reports itself as “mobile”.
|
|
* Very simple, not very reliable.
|
|
*/
|
|
export default function isMobileDevice(): boolean {
|
|
if (
|
|
typeof window !== 'undefined' &&
|
|
window.navigator &&
|
|
window.navigator.userAgent &&
|
|
window.navigator.userAgent.match(/Mobi/)
|
|
) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|