How to detect Safari browser using JavaScript? I have tried code below and it detects not only Safari but also Chrome browser.
function IsSafari() {
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;
return is_safari;
}