Can I detect cpu type and speed, and/or amount of ram a computer has from a web page (javascript hopefully)?

本秂侑毒 提交于 2019-12-07 00:00:37

问题


Can I detect cpu type and speed, and/or amount of ram a computer has from a web page (javascript hopefully)?


回答1:


The only thing with any knowledge of the system on which it's running is the Operating System. The Operating System creates an abstraction layer in which every application runs. Applications can't know what processor you have or how much RAM you have without asking the Operating System. No modern browser will ask.

The Java Virtual Machine does ask the Operating System, so you could do it with a Java applet.

Otherwise you'd need a browser plugin.




回答2:


No, that's not possible. There is no access to hardware information through JavaScript in web browsers. You might have some luck using browser plugins, ActiveX, etc.




回答3:


It is not possible to detect CPU type and speed. But you can find number of cores and CPU manufacturer information. You can figure out system performance based on number of CPU cores. Number of cores is directly proportional to performance. Higher core machine gives good performance.

navigator.hardwareConcurrency shows the number of CPU cores, but it works only on chrome.

navigator.hardwareConcurrency

navigator.userAgent gives the complete OS and browser information.

navigator.userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"

navigator.platform shows System info

navigator.platform
"MacIntel"

Hope this helps.




回答4:


This info isn't available, at least not in a consistent or reliable way using only JavaScript...flash may be an option, but there are many security restrictions around that too, so I'm not sure what's available to it.




回答5:


Nope, that's not possible. Unless you're going to ask the user, programmatically.




回答6:


In IE you can detect the cpuClass. It doesn't tell you much, but maybe there is any use for you.

http://msdn.microsoft.com/en-us/library/ms533697%28v=VS.85%29.aspx




回答7:


If your end goal is doing different actions based on the whether or not they'll render fast/correctly on the users comp, you could time certain keystone processes and run different processes based on the result.



来源:https://stackoverflow.com/questions/3817775/can-i-detect-cpu-type-and-speed-and-or-amount-of-ram-a-computer-has-from-a-web

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