Last active
June 25, 2020 22:44
-
-
Save demonixis/2ec409c5e8a5912c3882 to your computer and use it in GitHub Desktop.
Gets the user's GPU name using the `WEBGL_debug_renderer_info` WebGL extension. It returns a `string` with the graphics card name or `unknow` if the extension is not supported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getGraphicsCardName() { | |
var canvas = document.createElement("canvas"); | |
var gl = canvas.getContext("experimental-webgl") || canvas.getContext("webgl"); | |
if (!gl) { | |
return "Unknow"; | |
} | |
var ext = gl.getExtension("WEBGL_debug_renderer_info"); | |
if (!ext) { | |
return "Unknow"; | |
} | |
return gl.getParameter(ext.UNMASKED_RENDERER_WEBGL); | |
} | |
getGraphicsCardName(); | |
// ANGLE (Intel(R) HD Graphics 4600 Direct3D11 vs_5_0 ps_5_0) On Google Chrome 50 dev | |
// Intel(R) HD Graphics 4600 On Microsoft Edge 13 or Internet Explorer 11.63.10586.0 / 11.0.26 | |
// Unknow on Firefox 44 by default | |
// ANGLE (Intel(R) HD Graphics 4600 Direct3D11 vs_5_0 ps_5_0) on Firefox 44 by enabling the `webgl.enable-debug-renderer-info` flag in `about:config` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I have webgl debugger renderer data, how can I filter out malicious ones?