Skip to content

Instantly share code, notes, and snippets.

@JuanLuisClaure
Created June 20, 2017 20:44
Show Gist options
  • Save JuanLuisClaure/89516fbe9a6c06f634e02275615b2cd7 to your computer and use it in GitHub Desktop.
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
/
// // 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