Auto-deploy: 2026-06-02 18:44:31
This commit is contained in:
14
popup.js
14
popup.js
@@ -288,9 +288,11 @@ function initDictation() {
|
||||
statusEl.textContent = '✨ جارٍ التحسين بواسطة الذكاء الاصطناعي...';
|
||||
refineWithGemini(textToProcess);
|
||||
} else {
|
||||
if (!statusEl.textContent.includes('❌')) {
|
||||
statusEl.textContent = 'اضغط للتحدث (بالعربية)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Listen to messages from the offscreen document via the background
|
||||
chrome.runtime.onMessage.addListener((message) => {
|
||||
@@ -347,8 +349,16 @@ function initDictation() {
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.id = 'lja-dictation-frame';
|
||||
iframe.src = url;
|
||||
iframe.style.display = 'none';
|
||||
// Allow microphone explicitly if needed
|
||||
// Avoid display:none because Chrome blocks SpeechRecognition in hidden cross-origin iframes
|
||||
iframe.style.position = 'fixed';
|
||||
iframe.style.top = '0';
|
||||
iframe.style.left = '0';
|
||||
iframe.style.width = '1px';
|
||||
iframe.style.height = '1px';
|
||||
iframe.style.opacity = '0';
|
||||
iframe.style.pointerEvents = 'none';
|
||||
iframe.style.zIndex = '-9999';
|
||||
iframe.style.border = 'none';
|
||||
iframe.setAttribute('allow', 'microphone');
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user