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

Wrappers for Web Audio API. More...

Functions

function audioFarbleInt (array)
 
function whiteNoiseInt (array)
 
function whiteNoiseFloat (array)
 

Variables

var audioFarbleBody = 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
Copyright (C) 2023 Martin Zmitko
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.
Bug:
Possibly inconsistant data between AudioBuffer and AnalyserNode wrappers.
Bug:
Inconsistency between AudioBuffer.prototype.copyFromChannel and AudioBuffer.prototype.getChannelData. AudioBuffer.prototype.copyFromChannel should call AudioBuffer.prototype.getChannelData wrapper and then return result of the original call.

Function Documentation

◆ audioFarbleInt()

function audioFarbleInt (   array)
Here is the call graph for this function:

◆ whiteNoiseFloat()

function whiteNoiseFloat (   array)

◆ whiteNoiseInt()

function whiteNoiseInt (   array)

Variable Documentation

◆ audioFarbleBody

String audioFarbleBody = 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