JavaScript Restrictor
Browser extension that improves privacy and security
wrappingS-WEBA.js File Reference

Wrappers for Web Audio API. More...

Functions

function pseudoRandomSequence (seed)
 seeded pseudo random sequence using lfsr_next32 More...
 
function audioFarble (arr)
 Modifies audio data. More...
 
 add_wrappers (wrappers)
 

Variables

var audioFarbleBody = strToUint + lfsr_next32 + pseudoRandomSequence + audioFarble
 
var wrappers
 

Detailed Description

Wrappers for Web Audio API.

See also
https://webaudio.github.io/web-audio-api
Author
Copyright (C) 2021 Matus Svancar
License:
SPDX-License-Identifier: GPL-3.0-or-later
License:
SPDX-License-Identifier: MPL-2.0

This file contains wrappers for AudioBuffer and AnalyserNode related calls

The goal is to prevent fingerprinting by modifying the values from functions which are reading/copying from AudioBuffer and AnalyserNode. So the audio content of wrapped objects is the same as intended.

The modified content can be either a white noise based on domain key or a fake audio data that is modified according to domain key to be different than the original albeit very similar (i.e. the approach inspired by the algorithms created by Brave Software https://brave.com available at https://github.com/brave/brave-core/blob/master/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.cc.)

Note
Both approaches are detectable by a fingerprinter that checks if a predetermined audio is the same as the read one. Nevertheless, the aim of the wrappers is to limit the finerprintability.

Function Documentation

◆ add_wrappers()

add_wrappers ( wrappers  wrappers)

Adds a list of wrapping objects to the build_wrapping_code.

This function is called from each wrapper in its file.

◆ audioFarble()

function audioFarble (   arr)

Modifies audio data.

Parameters
arrtyped array with data - Uint8Array or Float32Array

Depending on level chosen this function modifies arr content:

  • (0) - multiplies values by fudge factor based on domain key
  • (1) - replace values by white noise based on domain key
Here is the call graph for this function:

◆ pseudoRandomSequence()

function pseudoRandomSequence (   seed)

seeded pseudo random sequence using lfsr_next32

Parameters
seedNumber used as seed at first call
Here is the caller graph for this function:

Variable Documentation

◆ audioFarbleBody

String audioFarbleBody = strToUint + lfsr_next32 + pseudoRandomSequence + audioFarble

Contains functions for modyfing audio data according to chosen level of protection - (0) - replace by white noise (range <0,0.1>) based on domain key (1) - multiply array by fudge factor based on domain key

◆ wrappers

var wrappers