Try:
var os = navigator.platform;
Then handle the os variable accordingly for your result.
You can also loop through each object of the navigator
object to help get you more familiarized with the objects:
<script type="text/javascript">
for(var i in navigator){
console.log(i+"="+navigator[i]+'<br>');
}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…