=== Research
As more users visit this site and opt into helping Camoufox's WebGL research, I will have a more solid profile of each GPU's parameters, supported extensions, context attributes, & shader precision formats.

[!ref See analytics & research](/webgl-research.md)

===

---

## Demo site

This repository includes a demo site that prints your browser's WebGL parameters. You can use this site to generate WebGL fingerprints for Camoufox from other devices.

[!ref See demo](https://camoufox.com/tests/webgl)

<img src="../../static/webgl-fp.png">

---

## Properties

Camoufox supports spoofing WebGL parameters, supported extensions, context attributes, and shader precision formats.

> [!WARNING]
> Do **NOT** randomly assign values to these properties. WAFs hash your WebGL fingerprint and compare it against a dataset. Randomly assigning values will lead to detection as an unknown device.

| Property                                        | Description                                                                                                           | Example                                                                                 |
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `webGl:renderer`                                  | Spoofs the name of the unmasked WebGL renderer.                                                                       | `"NVIDIA GeForce GTX 980, or similar"`                                                  |
| `webGl:vendor`                                    | Spoofs the name of the unmasked WebGL vendor.                                                                         | `"NVIDIA Corporation"`                                                                  |
| `webGl:supportedExtensions`                       | An array of supported WebGL extensions ([full list](https://registry.khronos.org/webgl/extensions/)).                 | `["ANGLE_instanced_arrays", "EXT_color_buffer_float", "EXT_disjoint_timer_query", ...]` |
| `webGl2:supportedExtensions`                      | The same as `webGl:supportedExtensions`, but for WebGL2.                                                              | `["ANGLE_instanced_arrays", "EXT_color_buffer_float", "EXT_disjoint_timer_query", ...]` |
| `webGl:contextAttributes`                         | A dictionary of WebGL context attributes.                                                                             | `{"alpha": true, "antialias": true, "depth": true, ...}`                                |
| `webGl2:contextAttributes`                        | The same as `webGl:contextAttributes`, but for WebGL2.                                                                | `{"alpha": true, "antialias": true, "depth": true, ...}`                                |
| `webGl:parameters`                                | A dictionary of WebGL parameters. Keys must be GL enums, and values are the values to spoof them as.                  | `{"2849": 1, "2884": false, "2928": [0, 1], ...}`                                       |
| `webGl2:parameters`                               | The same as `webGl:parameters`, but for WebGL2.                                                                       | `{"2849": 1, "2884": false, "2928": [0, 1], ...}`                                       |
| `webGl:parameters:blockIfNotDefined`              | If set to `true`, only the parameters in `webGl:parameters` will be allowed. Can be dangerous if not used correctly.  | `true`/`false`                                                                          |
| `webGl2:parameters:blockIfNotDefined`             | If set to `true`, only the parameters in `webGl2:parameters` will be allowed. Can be dangerous if not used correctly. | `true`/`false`                                                                          |
| `webGl:shaderPrecisionFormats`                    | A dictionary of WebGL shader precision formats. Keys are formatted as `"<shaderType>,<precisionType>"`.               | `{"35633,36336": {"rangeMin": 127, "rangeMax": 127, "precision": 23}, ...}`             |
| `webGl2:shaderPrecisionFormats`                   | The same as `webGL:shaderPrecisionFormats`, but for WebGL2.                                                           | `{"35633,36336": {"rangeMin": 127, "rangeMax": 127, "precision": 23}, ...}`             |
| `webGl:shaderPrecisionFormats:blockIfNotDefined`  | If set to `true`, only the shader percisions in `webGl:shaderPrecisionFormats` will be allowed.                       | `true`/`false`                                                                          |
| `webGl2:shaderPrecisionFormats:blockIfNotDefined` | If set to `true`, only the shader percisions in `webGl2:shaderPrecisionFormats` will be allowed.                      | `true`/`false`                                                                          |
