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 7 months ago

Chand Dakhara replied 7 months ago

Answers (1)

Add Answer
Staff answered 7 months 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