How to detect Chromium OS using JavaScript?

梦想的初衷 提交于 2019-12-10 19:31:01

问题


I use Windows to develop my app and I use navigator.platform to detect the OS type.

I don't have a Chromium OS so I don't know what the value will be returned by the above script.

Can someone tell me what it returns on Chromium OS?


回答1:


In the userAgent you will get Chrome and then CrOS

For example: var ua = window.navigator.userAgent; // Then check if the UA is something like: Mozilla/5.0 (X11; CrOS i686 0.12.433) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.77 Safari/534.30

Here is a post I've wrote about it in the past: http://greenido.wordpress.com/2011/06/14/how-to-detect-it-is-a-chromebook/



来源:https://stackoverflow.com/questions/7385479/how-to-detect-chromium-os-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!