This change scrubs the device related info from GPUAdapterInfo namely vendor, architecture and device. This change adds a patch to the upstream gpu_adapter.cc to intercept right before the moment we create the gpu adapter info, to scrub out these attributes. It was not possible to do it in gpu_adapter_info.cc as it lacked any context around ExecutionContext which was needed to get the farbling level. Below are the final behaviour with different farbling levels after this change: Farbling "off" - No change in behaviour i.e no scrubbing will occur. Farbling "balanced" with WebGLBalancedFingerprintingProtection enabled - Scrub the device related info from GPUAdapterInfo. Farbling "balanced" with WebGLBalancedFingerprintingProtection disabled - No change in behaviour i.e no scrubbing will occur. Farbling "maximum": - Scrub the device related info from GPUAdapterInfo. Note that this is a new behaviour and not to tied to any feature flag. For maximum farbling it makes sense to have the maximum protection. Resolves brave/brave-browser#55677
25 lines
586 B
HTML
25 lines
586 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>WebGPU adapter info test</title>
|
|
<meta charset="utf-8">
|
|
</head>
|
|
<body>
|
|
<script>
|
|
window.gpuAdapterInfoPromise = (async () => {
|
|
if (!navigator.gpu) {
|
|
return 'no-gpu';
|
|
}
|
|
const adapter = await navigator.gpu.requestAdapter({
|
|
featureLevel: 'compatibility',
|
|
});
|
|
if (!adapter) {
|
|
return 'no-adapter';
|
|
}
|
|
const info = adapter.info;
|
|
return info.vendor + ',' + info.architecture + ',' + info.device;
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|