From 9c285b426ffe65556bc9679c7735363a5a9a02f5 Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Sat, 16 May 2026 12:46:31 +0000 Subject: [PATCH] fix(tts): guard getVoices() against browser extension crash (Brave anti-fingerprinting, issue #61) --- assets/js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/app.js b/assets/js/app.js index a8ec687..0f4f7ce 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -12494,7 +12494,10 @@ function _initBrowserTtsVoices(selectedVoice) { sel.innerHTML = ''; const populate = () => { - const voices = (window.speechSynthesis.getVoices() || []).filter(v => v != null && v.lang); + let voices = []; + try { + voices = (window.speechSynthesis.getVoices() || []).filter(v => v != null && v.lang); + } catch (_) { return false; } if (!voices.length) return false; // Italian voices first, then others const it = voices.filter(v => v.lang.startsWith('it'));