How to find the operating system version using Jav

2018-12-31 07:31发布

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

13条回答
旧时光的记忆
2楼-- · 2018-12-31 07:56

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.

查看更多
登录 后发表回答