Guest User

Untitled

a guest
Aug 23rd, 2019
79
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