diff --git a/public_html/index.html b/public_html/index.html index 0e5c128..e858b75 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1760,7 +1760,7 @@ function _drawTopo() { var isAsleep = false; var _sleepRefreshTimer = null; -var SLEEP_CMDS = /\b(good\s*night|go\s*to\s*sleep|sleep\s*(mode|now)?|shut\s*(down|off)\s*(jarvis|for\s*the\s*night)?|offline|stand\s*by|power\s*down|hibernate|signing\s*off)\b/i; +var SLEEP_CMDS = /\b(good\s*night(\s*jarvis)?|go\s*to\s*sleep|sleep\s*mode|shut\s*(down|off)\s*(jarvis|for\s*the\s*night)|go\s*offline|going\s*offline|jarvis\s*(go\s*)?(offline|sleep|shutdown)|stand\s*by\s*mode|power\s*down(\s*jarvis)?|signing\s*off)\b/i; function enterSleepMode() { if (isAsleep) return; @@ -1833,13 +1833,9 @@ function _focusWindow() { if (++_flashCount >= 8) { clearInterval(_titleFlash); document.title = _origTitle; } }, 400); - // Browser Notification API — fires even when window is minimized - if ('Notification' in window) { - if (Notification.permission === 'granted') { - new Notification('JARVIS', { body: 'Wake word detected — system online.', icon: '/favicon.ico', tag: 'jarvis-wake', requireInteraction: false }); - } else if (Notification.permission !== 'denied') { - Notification.requestPermission(); - } + // Notify if already have permission — never request during voice activity + if ('Notification' in window && Notification.permission === 'granted') { + try { new Notification('JARVIS', { body: 'Wake word detected.', tag: 'jarvis-wake', requireInteraction: false }); } catch(e) {} } } @@ -2215,10 +2211,6 @@ function showApp(name, greeting, silent = false) { } }, 12000); startListening(); - // Request notification permission for wake-word alerts when minimized - if ('Notification' in window && Notification.permission === 'default') { - setTimeout(() => Notification.requestPermission(), 3000); - } loadNetwork(); loadHA(); checkAgentStatus();