Skip to content

Commit

Permalink
Consistent naming of webgl properties
Browse files Browse the repository at this point in the history
Always use "webgl:" instead of "webGl:"
  • Loading branch information
daijro committed Oct 14, 2024
1 parent 41bc102 commit 1532d7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,17 @@ Camoufox supports spoofing WebGL parameters, supported extensions, context attri
| 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", ...]` |
| 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", ...]` |
| 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: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 passed. Everything else will be blocked. | `true` |
| webgl2:shaderPrecisionFormats:blockIfNotDefined | If set to `true`, only the shader percisions in `webGl2:shaderPrecisionFormats` will be passed. Everything else will be blocked. | `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: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 passed. Everything else will be blocked. | `true` |
| webgl2:shaderPrecisionFormats:blockIfNotDefined | If set to `true`, only the shader percisions in `webgl2:shaderPrecisionFormats` will be passed. Everything else will be blocked. | `true` |
</details>
Expand Down
4 changes: 2 additions & 2 deletions patches/webgl-spoofing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ index db60868f65..afed6eeb7c 100644

switch (pname) {
case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_RENDERER_WEBGL:
+ if (auto value = MaskConfig::GetString("webGl:renderer")) {
+ if (auto value = MaskConfig::GetString("webgl:renderer")) {
+ ret = Some(value.value());
+ break;
+ }
Expand All @@ -253,7 +253,7 @@ index db60868f65..afed6eeb7c 100644
break;

case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_VENDOR_WEBGL:
+ if (auto value = MaskConfig::GetString("webGl:vendor")) {
+ if (auto value = MaskConfig::GetString("webgl:vendor")) {
+ ret = Some(value.value());
+ break;
+ }
Expand Down
4 changes: 2 additions & 2 deletions settings/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
{ "property": "AudioContext:sampleRate", "type": "uint" },
{ "property": "AudioContext:outputLatency", "type": "double" },
{ "property": "AudioContext:maxChannelCount", "type": "uint" },
{ "property": "webGl:renderer", "type": "str" },
{ "property": "webGl:vendor", "type": "str" },
{ "property": "webgl:renderer", "type": "str" },
{ "property": "webgl:vendor", "type": "str" },
{ "property": "webgl:supportedExtensions", "type": "array" },
{ "property": "webgl:parameters", "type": "dict" },
{ "property": "webgl2:parameters", "type": "dict" },
Expand Down

0 comments on commit 1532d7b

Please sign in to comment.