JavaScript Restrictor
Browser extension that improves privacy and security
|
Wrappers for WebGL Specification standards (both 1.0 and 2.0) More...
Functions | |
function | farbleNull (name, ctx,...fcarg) |
Returns null or output of given function. | |
function | farbleZero (name, ctx,...fcarg) |
Returns 0 or output of given function. | |
function | farbleMinusOne (name, ctx,...fcarg) |
Returns -1 or output of given function. | |
function | farbleNullArray (name, ctx,...fcarg) |
Returns [] or output of given function. | |
function | farbleGetPrecisionFormat (ctx,...fcarg) |
Returns empty WebGLShaderPrecisionFormat object or real value. | |
function | farbleGetActives (name, ctx,...fcarg) |
Returns empty WebGLActiveInfo object or real value. | |
function | farbleGetFramebufferAttachmentParameter (ctx, target, attachment, pname) |
Returns modified WebGLRenderingContext.getFramebufferAttachmentParameter output for some specific parameters, original value for the rest. | |
function | farbleGetVertexAttrib (ctx, index, pname) |
Returns modified WebGLRenderingContext.getVertexAttrib output for some specific parameters, original value for the rest. | |
function | farbleGetBufferParameter (ctx, target, pname) |
Returns modified WebGLRenderingContext.getBufferParameter output for some specific parameters, original value for the rest. | |
function | farbleGetShaderParameter (ctx, shader, pname) |
Returns modified WebGLRenderingContext.getShaderParameter output for some specific parameters, original value for the rest. | |
function | farbleGetRenderbufferParameter (ctx, target, pname) |
Returns modified WebGLRenderingContext.getRenderbufferParameter output for some specific parameters, original value for the rest. | |
function | farbleGetProgramParameter (ctx, program, pname) |
Returns modified WebGLRenderingContext.getProgramParameter output for some specific parameters, original value for the rest. | |
function | farblePixels (gl, x, y, width, height, format, type, outpixels, offset) |
Modifies pixels array. | |
Variables | |
function let | farbleGetParameterString |
var | unmasked_vendor = randomString(8, 0, webgl_prng) |
var | vendor = randomString(8, 0, webgl_prng) |
var | unmasked_renderer = randomString(8, 0, webgl_prng) |
var | renderer = randomString(8, 0, webgl_prng) |
const | STATIC_RANDOM_VALUE = webgl_prng.uint32() |
farbleGetParameter | |
var | wrappers |
Wrappers for WebGL Specification standards (both 1.0 and 2.0)
This file contains wrappers for WebGL related calls
The goal is to prevent fingerprinting by modifying the values from certain WebGLRenderingContext API functions. This includes return values of various functions which can be hardware/software specific and image data reading.
Content is either modified according to domain and session keys to be different than the original albeit very similar or replaced by bottom value which is consistent every time. Both approaches are inspired by the algorithms created by Brave Software available here and here.
This wrapper operates with two levels of protection:
Level 0 is trying to force WebGL fingeprint to be unique on every domain and every session. This can be effective when used with other wrappers with same options. This level causes breakage of websites using WebGL only rarely. Level 1 is trying to return as little information as possible while being consistent across domains and sessions. This level can cause breakage on majority of websites using WebGL.
function farbleGetActives | ( | name, | |
ctx, | |||
fcarg | |||
) |
Returns empty WebGLActiveInfo object or real value.
name | of original function |
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
function farbleGetBufferParameter | ( | ctx, | |
target, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getBufferParameter output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
target | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleGetFramebufferAttachmentParameter | ( | ctx, | |
target, | |||
attachment, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getFramebufferAttachmentParameter output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
target | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
attachment | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleGetPrecisionFormat | ( | ctx, | |
fcarg | |||
) |
Returns empty WebGLShaderPrecisionFormat object or real value.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
function farbleGetProgramParameter | ( | ctx, | |
program, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getProgramParameter output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
program | WebGLProgram object (https://developer.mozilla.org/en-US/docs/Web/API/WebGLProgram) |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleGetRenderbufferParameter | ( | ctx, | |
target, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getRenderbufferParameter output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
target | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleGetShaderParameter | ( | ctx, | |
shader, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getShaderParameter output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
program | WebGLShader object (https://developer.mozilla.org/en-US/docs/Web/API/WebGLShader) |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleGetVertexAttrib | ( | ctx, | |
index, | |||
pname | |||
) |
Returns modified WebGLRenderingContext.getVertexAttrib output for some specific parameters, original value for the rest.
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
index | GLuint specifying index |
pname | GLenum (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants) |
Depending on level chosen this function returns:
function farbleMinusOne | ( | name, | |
ctx, | |||
fcarg | |||
) |
Returns -1 or output of given function.
name | of original function |
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
function farbleNull | ( | name, | |
ctx, | |||
fcarg | |||
) |
Returns null or output of given function.
name | of original function |
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
function farbleNullArray | ( | name, | |
ctx, | |||
fcarg | |||
) |
Returns [] or output of given function.
name | of original function |
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
function farblePixels | ( | gl, | |
x, | |||
y, | |||
width, | |||
height, | |||
format, | |||
type, | |||
outpixels, | |||
offset | |||
) |
Modifies pixels array.
gl | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
x | starting x position |
y | starting y position |
width | width to be read (in pixels) |
height | height to be read (in pixels) |
format | format of read pixel data |
type | specifies data type of pixels |
pixels | typed array to return result |
offset | optional offset |
Depending on level chosen this function returns to pixels array:
function farbleZero | ( | name, | |
ctx, | |||
fcarg | |||
) |
Returns 0 or output of given function.
name | of original function |
ctx | WebGLRenderingContext (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) |
...fcarg | delegated arguments depending on function |
Depending on level chosen this function returns:
farbleGetParameter |
function let farbleGetParameterString |
var renderer = randomString(8, 0, webgl_prng) |
const STATIC_RANDOM_VALUE = webgl_prng.uint32() |
var unmasked_renderer = randomString(8, 0, webgl_prng) |
var unmasked_vendor = randomString(8, 0, webgl_prng) |
var vendor = randomString(8, 0, webgl_prng) |
var wrappers |