简体   繁体   中英

How to detect Operating System with JavaScript (without deprecated window.navigator)

Detecting the operating system of a visitor used to be easy with the navigator.platform solution. However, this solution is now deprecated, so my question, quite simply, is there another way to retrieve the OS using JavaScript?

I have looked around the web and everything seems to point towards the navigator object, but as you can see from the following link, this has been deprecated...

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/platform

This can be usefull for you, a small project from github.

https://github.com/Pagawa/PgwBrowser http://pgwjs.com/pgwbrowser/

The code to use var pgwBrowser = $.pgwBrowser();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM