Skip to content

Instantly share code, notes, and snippets.

View ViktorAndonov's full-sized avatar
🛠️
Building UIs for the people

Viktor ViktorAndonov

🛠️
Building UIs for the people
View GitHub Profile
@ViktorAndonov
ViktorAndonov / system-test.js
Last active September 17, 2015 15:55
Test if to see what users uses Mac or PC (in JS)
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);