[英]Tell if browser is chrome running on windows or mac/linux
Is there an easy way to tell if chrome is under windows or mac/linux? 有没有一种简单的方法来判断chrome是在windows还是mac / linux下?
I have a webbapplication where the browser behaves different when running it on MAC and PC. 我有一个webbapplication,浏览器在MAC和PC上运行时表现不同。
Try this 尝试这个
function testOS(){
var mac=navigator.userAgent.match(/(Mac)/i)?true:false;
if($.browser.webkit){
if(mac){
//Mac Code
}
else{
//window code
}
}
}
Yes there is. 就在这里。 Hope the below code will help. 希望以下代码有所帮助。
if (navigator.appVersion.indexOf("Win")!=-1){
//It is Windows
}else if(navigator.appVersion.indexOf("Linux")!=-1){
//It is Linux
}else if((navigator.appVersion.indexOf("Mac")!=-1){
//It is Mac
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.