How to find the operating system version using JavaScript?

后端 未结 13 1098
滥情空心
滥情空心 2020-11-22 04:32

How can I find the OS name and OS version using JavaScript?

13条回答
  •  独厮守ぢ
    2020-11-22 05:21

    JavaScript have access to the window.navigator.platform - a string representing the platform of the browser: https://developer.mozilla.org/en/DOM/window.navigator.platform

    Use it to extract whatever details you need (and can). Note that there are no guarantees that the client actually uses that platform since this can easily be modified in many ways.

提交回复
热议问题