在ARM Mac上,navigator.platform的价值是什么? [英] What's the value of navigator.platform on ARM Macs?

查看:54
本文介绍了在ARM Mac上,navigator.platform的价值是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple已> 几款基于M1芯片且使用ARM的新计算机体系结构(与以前基于x86体系结构的计算机形成对比).新ARM计算机上的Safari,Chrome和其他浏览器中的 navigator.platform JavaScript变量的值是什么?另外,用户代理是什么(应该包含平台名称)?

您可以使用以下代码段检查您的代码:

  console.log(navigator.platform);console.log(navigator.userAgent);  

解决方案

在我真正的MacBook Air(M1)上进行测试,并且ARM Macs上的Chrome的 navigator.platform 值仍然是 MacIntel.我认为将来会改变,这只是他们M1版本的第一个版本.

同样,用户代理也是Intel: Mozilla/5.0(Macintosh; Intel Mac OS X 11_0_1)AppleWebKit/537.36(KHTML,例如Gecko)Chrome/87.0.4280.67 Safari/537.36

如果要检测您是否在ARM M1 Mac上,则可以读取 WebGL Renderer 值,该值为 Apple M1 .

Apple has released several new computers based on M1 chip which uses ARM architecture (in contrast to previous computers that are based on x86 architecture). What is the value of the navigator.platform JavaScript variable in Safari, Chrome and other browsers on the new ARM computers? Also, what's the user agent (it should contain the platform name)?

You can check yours using this snippet:

console.log(navigator.platform);
console.log(navigator.userAgent);

解决方案

Tested on my real MacBook Air (M1) and the navigator.platform value for Chrome on ARM Macs is still MacIntel. I assume that will change in the future, this is just the first version of their M1 build.

Likewise, the user agent is also Intel: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36

If you want to detect if you're on an ARM M1 Mac, you can read the WebGL Renderer value which is Apple M1.

这篇关于在ARM Mac上,navigator.platform的价值是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆