javascript - 获取CPU / GPU /内存信息

我需要得到关于CPU/GPU/内存的任何信息。核心的数量,内存值,内存和CPU使用率…
我找到了一个为IE做这件事的方法:How to Use JavaScript to Find Hardware Information
其他浏览器的解决方案我不知道。知道怎么做吗?
也许WebGL可以访问有关您计算机的信息?
还是闪光灯?
或者其他技术?
非常感谢你


最佳答案:

此代码将打印GPU信息,并列出您可以使用此浏览器的性能对象获得的所有信息(物料清单没有标准,因此每个浏览器都会更改)。

<html>

<body>
  <canvas id="glcanvas" width="0" height="0"></canvas>
  <script>
    var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};

    document.write("<br>");
    for (var value in performance) {
      document.write(value + "<br>");
    }

    document.write("<br><br><br>");

    var canvas;
    canvas = document.getElementById("glcanvas");
    var gl = canvas.getContext("experimental-webgl");

    document.write(gl.getParameter(gl.RENDERER) + "<br>");
    document.write(gl.getParameter(gl.VENDOR) + "<br>");
    document.write(getUnmaskedInfo(gl).vendor + "<br>");
    document.write(getUnmaskedInfo(gl).renderer + "<br>");


    function getUnmaskedInfo(gl) {
      var unMaskedInfo = {
        renderer: '',
        vendor: ''
      };

      var dbgRenderInfo = gl.getExtension("WEBGL_debug_renderer_info");
      if (dbgRenderInfo != null) {
        unMaskedInfo.renderer = gl.getParameter(dbgRenderInfo.UNMASKED_RENDERER_WEBGL);
        unMaskedInfo.vendor = gl.getParameter(dbgRenderInfo.UNMASKED_VENDOR_WEBGL);
      }

      return unMaskedInfo;
    }
  </script>
</body>

铬合金输出:
onresourcetimingbufferfull
onwebkitresourcetimingbufferfull
timing
navigation
memory
now
getEntries
getEntriesByType
getEntriesByName
clearResourceTimings
setResourceTimingBufferSize
webkitClearResourceTimings
webkitSetResourceTimingBufferSize
mark
clearMarks
measure
clearMeasures
addEventListener
removeEventListener
dispatchEvent



WebKit WebGL
WebKit
NVIDIA Corporation
NVIDIA GeForce GTX 775M OpenGL Engine

FirBox中的输出:
now
getEntries
getEntriesByType
getEntriesByName
clearResourceTimings
setResourceTimingBufferSize
mark
clearMarks
measure
clearMeasures
toJSON
timing
navigation
onresourcetimingbufferfull



Mozilla
Mozilla

Safari中的输出:
navigation
timing
now



WebKit WebGL
WebKit
NVIDIA Corporation
NVIDIA GeForce GTX 775M OpenGL Engine

评论