How to find the operating system version using JavaScript?

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

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

13条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 05:23

    I've created a library for parsing User Agent strings called Voodoo. But be aware that this should not be used instead of feature detection.

    What Voodoo does, is that it parses the userAgent string, which is found in the Navigator object (window.navigator). It's not all browsers that passes a reliable userAgent string, so even though it's the normal way to do it, the userAgent can not always be trusted.

提交回复
热议问题