How to find operating system in the client machine using JavaScript?
1 Like
Navigator objects helps in getting client’s OS info. You can use the following code snippet to get user OS:
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
alert('Your OS: '+OSName);