I am trying to detect if the browser is Safari. If so, only then do something. In all other browsers, do something else:
if ( navigator.userAgent.toLowerCase().indexOf('safari') == -1) {
//if safari execute some function
} else {
// if other browsers execute other function
}
However, I guess I am not using the right approach because it's not working. :P
if(typeof navigator.vendor!='undefined') &&
navigator.vendor.toLowerCase().indexOf('apple')!=-1){
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With