From 570daf2ee3094f4c26f66dfa3bea443f9fd98665 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 1 Mar 2026 14:57:05 +0100 Subject: [PATCH] fix: show clear error when microphone used without HTTPS navigator.mediaDevices is undefined in insecure contexts, causing "undefined is not an object" error. Now shows actionable message. Co-Authored-By: Claude Opus 4.6 --- src/web/public/voice-input.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/web/public/voice-input.js b/src/web/public/voice-input.js index f931739b..279b0146 100644 --- a/src/web/public/voice-input.js +++ b/src/web/public/voice-input.js @@ -30,6 +30,11 @@ const DeepgramProvider = { this._onEnd = opts.onEnd; // 1. Get microphone access + if (!navigator.mediaDevices?.getUserMedia) { + this._onError?.('Microphone requires a secure context (HTTPS). Use --https flag or access via localhost.'); + this._cleanup(); + return; + } try { this._stream = await navigator.mediaDevices.getUserMedia({ audio: { noiseSuppression: true, echoCancellation: true, autoGainControl: true }