apamphilon

Detect OS

var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
else if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
else if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
else if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";

console.log('Your OS is: '+OSName);

Comments: