Created
July 20, 2023 16:53
-
-
Save zempo/36b3298c7d4d6ac40e279e9e2d746cf0 to your computer and use it in GitHub Desktop.
Common helper functions and objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const COND = { | |
//*TRUE if "needlessly difficult to code for" apple product™ | |
check_ios: () => { | |
return ( | |
['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes( | |
navigator.platform | |
) || | |
// iPad on iOS 13 detection | |
(navigator.userAgent.includes('Mac') && 'ontouchend' in document) | |
); | |
}, | |
// *TRUE if android phone | |
check_droid: /(android)/i.test(navigator.userAgent) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment