Ibrahim D.
Ibrahim D.

Reputation: 326

How does javascript access my GPU driver name

When I visit https://browserleaks.com/webgl it shows my driver name under the WebGL Context Info > ANGLE

I want to ask, how does javascript is able to access such info? I thought at first that they are accessing my registry keys, but I changed all the names of my driver in the registry and still was being detected by javascript (old name that I changed)

So if it is not the registry, then how does javascript deal with the OS to inquire about my driver's name?

Thank you guys

Upvotes: 0

Views: 1476

Answers (2)

Ibrahim D.
Ibrahim D.

Reputation: 326

As it turned out, WebGL access my system via DirectX (Direct3D)

Upvotes: -1

pirs
pirs

Reputation: 2463

You can do it with a webgl canvas:

var canvas = document.getElementById("myTestCanvas");

var gl = canvas.getContext("experimental-webgl"); // or webgl
console.log(gl.getParameter(gl.RENDERER));
console.log(gl.getParameter(gl.VENDOR));

var debug = gl.getExtension('WEBGL_debug_renderer_info');
console.log(gl.getParameter(debug.UNMASKED_VENDOR_WEBGL)); // drivers
console.log(gl.getParameter(debug.UNMASKED_RENDERER_WEBGL));

// and many others

Note: WebGL is directly related with OpenGL

More at:

https://developer.mozilla.org/fr/docs/Web/API/WEBGL_debug_renderer_info

https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getExtension

Upvotes: 3

Related Questions