Created
June 20, 2017 20:44
-
-
Save JuanLuisClaure/89516fbe9a6c06f634e02275615b2cd7 to your computer and use it in GitHub Desktop.
encontrar de que tipo de Iphone se ve y luego si es android
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
/ | |
// // Put the User Agent string in lowercase | |
// let ua = navigator.userAgent.toLowerCase(); | |
// // Better to test on mobi than mobile (Firefox, Opera, IE) | |
// | |
// if (/mobi/i.test(ua)) { | |
// console.log('estamos aca'); | |
// if(navigator.vendor != null && navigator.vendor.match(/Apple Computer, Inc./) && navigator.userAgent.match(/iPhone/i) || (navigator.userAgent.match(/iPod/i))) | |
// | |
// { | |
// | |
// alert("Ipod or Iphone"); | |
// | |
// } | |
// | |
// else if (navigator.vendor != null && navigator.vendor.match(/Apple Computer, Inc./) && navigator.userAgent.match(/iPad/i)) | |
// | |
// { | |
// | |
// alert("Ipad"); | |
// | |
// } | |
// | |
// else if (navigator.vendor != null && navigator.vendor.match(/Apple Computer, Inc./) && navigator.userAgent.indexOf('Safari') != -1) | |
// | |
// { | |
// | |
// alert("Safari"); | |
// | |
// } | |
// | |
// else if (navigator.vendor == null || navigator.vendor != null) | |
// | |
// { | |
// | |
// console.log("Not Apple Based Browser"); | |
// let isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); | |
// if(isAndroid) { | |
// alert('es una android') | |
// } | |
// | |
// } | |
// } else { | |
// console.log('Es una compu, No hacemos nada'); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment