From a3b8732ba28777a83eff8cb31bbff6a18ca357fc Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 2 Jun 2026 19:23:40 +0300 Subject: [PATCH] Auto-deploy: 2026-06-02 19:23:40 --- popup.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/popup.js b/popup.js index 42ce1e8..47a271e 100644 --- a/popup.js +++ b/popup.js @@ -287,7 +287,18 @@ function initDictation() { function stopRecording() { if (!isRecording) return; isRecording = false; - chrome.runtime.sendMessage({ type: 'STOP_RECORDING_FROM_POPUP' }); + + chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { + const activeTab = tabs[0]; + if (activeTab && activeTab.id) { + chrome.tabs.sendMessage(activeTab.id, { type: 'STOP_RECORDING_FROM_POPUP' }, () => { + if (chrome.runtime.lastError) { + console.warn('Could not send STOP message to tab:', chrome.runtime.lastError.message); + } + }); + } + }); + micBtn.style.background = 'linear-gradient(135deg, var(--accent), #9b5de5)'; micBtn.innerHTML = '🎤';