How to find an operating system in the client machine using JavaScript?

Forums JavaScriptHow to find an operating system in the client machine using JavaScript?
Staff asked 2 years ago

Chand Dakhara replied 2 years ago

Answers (1)

Add Answer
Staff answered 2 years ago
let system= "";
        if (navigator.appVersion.indexOf("Win") != -1) system=  //For Windows
          "Windows OS";
        if (navigator.appVersion.indexOf("Mac") != -1) system=   //For MacOS
          "MacOS";
        if (navigator.appVersion.indexOf("X11") != -1) system= // For UNIX 
          "UNIX OS";
        if (navigator.appVersion.indexOf("Linux") != -1) system= // For Linux
          "Linux OS";
This is how you can find an operating system of the client machine

Subscribe

Select Categories