From 3cd439e068b7cfd6ea34de4cb29382970bbfbbae Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Sat, 16 May 2026 07:38:15 +0000 Subject: [PATCH] fix(tts): filter null/undefined voices to handle Brave anti-fingerprinting Brave browser's anti-fingerprinting user-script (makeFakeVoiceFromVoice) intercepts the SpeechSynthesis voices array and crashes with 'undefined is not an object (evaluating Object.getPrototypeOf(voice))' when iterating over null voice entries. Defensive fix: filter null/undefined/no-lang entries from getVoices() before processing, so Brave's proxy never receives invalid objects. Fixes #58 --- assets/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/app.js b/assets/js/app.js index 5824ca0..731b9a8 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -12371,7 +12371,7 @@ function _initBrowserTtsVoices(selectedVoice) { sel.innerHTML = ''; const populate = () => { - const voices = window.speechSynthesis.getVoices(); + const voices = (window.speechSynthesis.getVoices() || []).filter(v => v != null && v.lang); if (!voices.length) return false; // Italian voices first, then others const it = voices.filter(v => v.lang.startsWith('it'));