Building an Anti-Fingerprinting Chromium Extension in Fuzio: Part 3 — Audio DSP, Multimedia, and Typography

In Part 1 and Part 2, we protected 2D canvas, text layout, 3D WebGL/WebGPU pipelines, and display properties. Even when every visual rendering surface is protected, tracking scripts can identify a machine through its non-visual multimedia and typography APIs — synthesizing an inaudible audio waveform, listing installed text-to-speech voices and microphones, probing hardware video decoders, and checking which desktop fonts are installed.
Prerequisites
To follow this tutorial, you need:
- Familiarity with the CRX3 packaging and extension bootstrap from Part 1 and Part 2.
- JDK 17 or later and a valid Fuzio license key (or a free 30-day trial key).
Revisiting Parts 1 and 2
We reuse the extension infrastructure from Parts 1 and 2 (content.js
injected into the MAIN world at document_start and packaged at runtime
with CrxPacker), along with three helpers:
DOMAIN_SESSION_SEEDandmixHash(value, seed)to derive deterministic per-domain noise stored insessionStorage.maskFunction(win, patchedFn, origFn)andoverrideGetterValue(win, proto, propName, constantValue)to preserve nativeFunction.prototype.toString()output on overridden prototype methods and getters.applyAllTechniques(targetWindow)to apply our patches to both the main window and dynamically accessed iframes.
How Audio, Multimedia, and Font Fingerprinting Works
When a web page processes audio, queries media capabilities, or checks font availability, Chromium delegates directly to CPU SIMD instructions and host OS subsystems on Linux, Windows, or macOS:
- Routing a
triangleOscillatorNodethrough aDynamicsCompressorNodeinside anOfflineAudioContextexecutes Blink’sDynamicsCompressorKernelusing architecture-specific SIMD instructions (AVX2on x86_64 vs.NEONon ARM64), producing a hardware-dependent floating-point sum whileAudioContext.prototype.baseLatencyexposes the OS audio buffer size. - Calling
window.speechSynthesis.getVoices()enumerates every text-to-speech voice and regional language pack installed on the host OS. - Calling
navigator.mediaDevices.enumerateDevices()returns the count and ordering ofaudioinput,videoinput, andaudiooutputperipherals along with origin-scopeddeviceIdandgroupIdhashes, even without microphone or camera permissions. - Probing
navigator.mediaCapabilities.decodingInfo()with high-resolutionVP9,AV1, orHEVCstreams reveals which codecs have dedicated GPU hardware decode blocks (powerEfficientandsmooth). - Calling
document.fonts.check("12px 'FontName'")synchronously probes thousands of OS and application fonts (such asMonaco,Segoe UI, orCalibri) without rendering a single pixel.
Step 1: Farble Web Audio DSP Samples and Normalize Latency
Tracking scripts on BrowserLeaks,
BrowserScan, and ToDetect render 4,500 samples in
an OfflineAudioContext and sum
AudioBuffer.prototype.getChannelData(0).
Adding noise to AudioBuffer requires two guards so anti-bot checks cannot
detect the extension:
- Because
getChannelData(channel)returns a liveFloat32Arrayview of the internal PCM buffer, callinggetChannelData(0)twice on the sameAudioBuffermust not add noise a second time. We track perturbedFloat32Arrayinstances in aWeakSet(noisedAudioChannels) so each buffer channel is modified at most once. - Anti-bot scripts allocate an empty
AudioBufferand verify that silent samples equal0. We only perturb finite non-zero samples (samples[i] !== 0), adding a seeded offset (1e-7step,-106 dB ) and normalizingAudioContext.prototype.baseLatencyto0.01(10 ms):
const noisedAudioChannels = new WeakSet();
function perturbNonZeroSamples(samples, seed) {
if (!samples || noisedAudioChannels.has(samples)) return samples;
for (let i = 0; i < samples.length; i++) {
if (samples[i] !== 0) {
const byteVal = (mixHash(i, seed) >>> 8) & 0xff;
const offset = byteVal === 128 ? 1 : byteVal - 128;
samples[i] += offset * 1e-7;
}
}
noisedAudioChannels.add(samples);
return samples;
}
function patchAudioContext(win, seed) {
const bufProto = win.AudioBuffer?.prototype;
if (bufProto) {
const origGetChannel = bufProto.getChannelData;
bufProto.getChannelData = function (channel) {
const raw = origGetChannel.call(this, channel);
return perturbNonZeroSamples(raw, seed);
};
}
const ctxProto = win.AudioContext?.prototype;
if (ctxProto) {
overrideGetterValue(win, ctxProto, "baseLatency", 0.01);
}
}
In the complete repository implementation, patchAudioContext also applies
the same non-zero sample perturbation to
AudioBuffer.prototype.copyFromChannel and
AnalyserNode.prototype.getFloatFrequencyData / getFloatTimeDomainData (using
Number.isFinite(array[i]) to skip -Infinity empty decibel bins).
Step 2: Normalize SpeechSynthesis Voice Lists
In patchSpeechSynthesisVoices, we wrap SpeechSynthesis.prototype.getVoices
to filter the host OS voice list down to at most three standard en-US
voices so regional and novelty TTS packs are not exposed:
function patchSpeechSynthesisVoices(win) {
const speechProto = win.SpeechSynthesis?.prototype;
if (!speechProto?.getVoices) return;
const origGetVoices = speechProto.getVoices;
speechProto.getVoices = function () {
const voices = origGetVoices.call(this);
if (!Array.isArray(voices)) return voices;
return voices
.filter((v) => v.lang?.toLowerCase().startsWith("en-us"))
.slice(0, 3);
};
}
Step 3: Normalize Media Peripherals and Codec Capabilities
To prevent navigator.mediaDevices.enumerateDevices()
from leaking the workstation’s microphone, webcam, and audio output count,
we return a fixed three-device topology (audioinput, videoinput, and
audiooutput) with empty labels and domain-seeded 64-character hex deviceId
and groupId identifiers, and normalize
MediaCapabilities.prototype.decodingInfo so supported codecs report uniform
hardware acceleration:
function patchMediaDevices(win, seed) {
const proto = win.MediaDevices?.prototype;
if (!proto?.enumerateDevices) return;
const audioGrp = deriveHexId(seed, 100);
const videoGrp = deriveHexId(seed, 200);
proto.enumerateDevices = () => Promise.resolve([
createSyntheticMediaDevice(
win, "audioinput", deriveHexId(seed, 1), audioGrp
),
createSyntheticMediaDevice(
win, "videoinput", deriveHexId(seed, 2), videoGrp
),
createSyntheticMediaDevice(
win, "audiooutput", deriveHexId(seed, 3), audioGrp
)
]);
}
function patchMediaCapabilities(win) {
const proto = win.MediaCapabilities?.prototype;
if (!proto?.decodingInfo) return;
const origDecodingInfo = proto.decodingInfo;
proto.decodingInfo = async function (config) {
const info = await origDecodingInfo.call(this, config);
if (!info || !info.supported) return info;
return { ...info, supported: true, smooth: true, powerEfficient: true };
};
}
In content.js, createSyntheticMediaDevice creates each entry with
Object.create(win.MediaDeviceInfo?.prototype) so instanceof MediaDeviceInfo
checks succeed.
Step 4: Filter System Font Enumeration
When a script calls document.fonts.check(font),
we extract the font family list from the CSS font shorthand and allow
only standard cross-platform families in BASELINE_FONT_FAMILIES, returning
false for OS- or application-specific fonts such as Monaco, Segoe UI, or
Calibri:
const BASELINE_FONT_FAMILIES = new Set([
"arial", "courier new", "georgia", "times new roman", "trebuchet ms",
"verdana", "serif", "sans-serif", "monospace", "system-ui"
]);
function isAllowedFontSpec(font) {
const match = String(font || "").match(
/\d+(?:\.\d+)?(?:px|pt|em|rem|%)\s+(.+)$/i
);
if (!match) return true;
return match[1]
.split(",")
.map((f) => f.trim().replace(/^['"]|['"]$/g, "").toLowerCase())
.filter(Boolean)
.every((family) => BASELINE_FONT_FAMILIES.has(family));
}
function patchFontEnumeration(win) {
const proto = win.FontFaceSet?.prototype;
if (!proto?.check) return;
const origCheck = proto.check;
proto.check = function (font, text) {
if (!isAllowedFontSpec(font)) return false;
return origCheck.apply(this, arguments);
};
}
In content.js, all five functions are masked with maskFunction and invoked
inside applyAllTechniques(targetWindow) so they also protect dynamically
created iframes.
Step 5: Verify Audio, Multimedia, and Font Surfaces in Fuzio
Run the audio-fingerprint tutorial from
fuzio-examples<YOUR_LICENSE_KEY> with your Fuzio license key:
./gradlew :audio-fingerprint:run -Dfuzio.license.key=<YOUR_LICENSE_KEY>
The application opens three BrowserView panes side by side (No Extension, Protected Profile 1, and Protected Profile 2) on the Part 3
inspection suite (with toolbar buttons to switch to BrowserLeaks
Fonts and BrowserLeaks JavaScript).
Comparing the default profile against the two isolated profiles shows
deterministic per-profile farbling on OfflineAudioContext and deviceId
alongside cohort normalization across latency, voices, codec capabilities, and
font enumeration:
| Surface | No Extension | Profile 1 (1st Call) | Profile 1 (2nd Call) | Profile 2 (1st Call) |
|---|---|---|---|---|
OfflineAudioContext sum | 124.273183 | 124.273160 | 124.273160 | 124.273212 |
Silent AudioBuffer[0] | 0 | 0 | 0 | 0 |
AudioContext.baseLatency | 0.005333 | 0.010000 | 0.010000 | 0.010000 |
speechSynthesis voices | 180 | 3 | 3 | 3 |
mediaDevices[0].deviceId | "" | 2ccb68ef... | 2ccb68ef... | cb089ce4... |
decodingInfo.powerEfficient | false | true | true | true |
fonts.check('Arial') | true | true | true | true |
fonts.check('Monaco') | true | false | false | false |
You can find the complete runnable project in the Gitee repository.
Conclusion
In Part 3 of this series, we extended our Manifest V3 Chromium extension in
Fuzio to add deterministic sub-audible noise to non-zero Web Audio DSP samples
and domain-seeded media deviceId hashes while normalizing
AudioContext.baseLatency, speechSynthesis voices, hardware video decode
flags, and document.fonts.check() enumeration.
In the next part of the series, we will protect hardware telemetry, OS sensors, high-resolution timers, WebRTC UDP IP leaks, and high-entropy HTTP Client Hint headers.
Add a Chromium-based browser engine to your Java desktop app with Fuzio.
Try for free
