Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32位64位浏览器识别 #54

Open
shaoshuai0102 opened this issue Aug 15, 2014 · 4 comments
Open

32位64位浏览器识别 #54

shaoshuai0102 opened this issue Aug 15, 2014 · 4 comments

Comments

@shaoshuai0102
Copy link

wow64 - 32位浏览器,跑在64位系统上
x64或win64或都有 - 64位浏览器

@hotoo
Copy link
Owner

hotoo commented Aug 15, 2014

有没有其他参考资料?链接什么的

@hotoo
Copy link
Owner

hotoo commented Aug 15, 2014

for Windows

    function getCPU()
    {
       var agent=navigator.userAgent.toLowerCase();
       if(agent.indexOf("win64")>=0||agent.indexOf("wow64")>=0) return "x64";
       return navigator.cpuClass;
    }

    function getCPU()
       { 
     var   shell   =   new   ActiveXObject( "Wscript.Shell");
     var value= shell.RegRead ("HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\PROCESSOR_ARCHITECTURE");

     value=value.toLowerCase();
     if(value.indexOf("64")>=0) return "x64";//amd64 ia64
     return "x86";
  }

for Mac

Apple Menu - About This Mac:

Processor 2.8 GHz Inter Core i5

Processor Name 32- or 64-bit
Intel Core Solo 32 bit
Intel Core Duo 32 bit
Intel Core 2 Duo 64 bit
Intel Quad-Core Xeon 64 bit
Dual-Core Intel Xeon 64 bit
Quad-Core Intel Xeon 64 bit
Core i3 64 bit
Core i5 64 bit
Core i7 64 bit

for Linux (NOT for JavaScript)

Others

@hotoo
Copy link
Owner

hotoo commented Aug 15, 2014

操作系统和浏览器的位数信息,可能对于大部分 Web 开发来说并不常用,这个功能是否需要整合到 detector 中还需要讨论。

@shaoshuai0102 建议你先参考上面的资料,针对业务需求先自行实现。

@shaoshuai0102
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants