SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function isIOS() {
  2.     let tester = new RegExp("/iPad|iPhone|iPod/")
  3.     let IOSdetected = tester.test(navigator.userAgent)
  4.     let msStreamNotUsed = isNullOrUndefined(window.MSStream) //prevent fake user agent in internet explorer
  5.  
  6.     if (IOSdetected === true && msStreamNotUsed) {
  7.         return true
  8.     }    
  9.     return false
  10. }
  11.  
  12. function isNullOrUndefined(input) {
  13.     return input === null || input === undefined
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top