Get CPU/GPU/memory information

Alex Nester picture Alex Nester · Mar 17, 2013 · Viewed 54.7k times · Source

I need to get any information about the CPU/GPU/memory.The number of cores, memory value, memory and cpu usage... I found a way to do this for IE:How to Use JavaScript to Find Hardware Information

solutions for other browsers I do not know. Any idea how to do it? maybe webgl has access to information about your computer? or flash? or any other technology?

Thank you very much

Answer

Thomas picture Thomas · Aug 15, 2016

This code will print GPU infos an will list all info you can have with the performance object of this browser (there is no standard for the BOM so it changes for each browser).

<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>

Output in Chrome :

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

Output in Firfox :

now
getEntries
getEntriesByType
getEntriesByName
clearResourceTimings
setResourceTimingBufferSize
mark
clearMarks
measure
clearMeasures
toJSON
timing
navigation
onresourcetimingbufferfull



Mozilla
Mozilla

Output in Safari :

navigation
timing
now



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