Auto-deploy: 2026-06-02 18:31:11

This commit is contained in:
Hamza-Ayed
2026-06-02 18:31:11 +03:00
parent 7cf9b474bb
commit 6601d7314f
3 changed files with 90 additions and 0 deletions

70
permission.html Normal file
View File

@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>السماح باستخدام الميكروفون</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #0a0a0f;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
text-align: center;
}
.container {
background: #1a1a26;
padding: 40px;
border-radius: 12px;
border: 1px solid rgba(108, 99, 255, 0.2);
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
max-width: 500px;
}
h1 {
color: #6c63ff;
margin-top: 0;
}
p {
color: #a0a0b8;
line-height: 1.6;
font-size: 16px;
margin-bottom: 30px;
}
.btn {
background: linear-gradient(135deg, #6c63ff, #4834d4);
color: white;
border: none;
padding: 12px 24px;
font-size: 16px;
border-radius: 8px;
cursor: pointer;
font-weight: bold;
transition: all 0.3s;
}
.btn:hover {
transform: scale(1.05);
box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}
.icon {
font-size: 48px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="icon">🎤</div>
<h1>مطلوب إذن الميكروفون</h1>
<p>ميزة الإملاء الصوتي تحتاج إلى إذن للوصول إلى الميكروفون لتعمل بشكل صحيح في الخلفية.</p>
<p>يرجى الضغط على الزر أدناه والموافقة على طلب الصلاحية من المتصفح.</p>
<button class="btn" id="grantBtn">منح صلاحية الميكروفون</button>
<p id="status" style="margin-top: 20px; font-weight: bold;"></p>
</div>
<script src="permission.js"></script>
</body>
</html>

19
permission.js Normal file
View File

@@ -0,0 +1,19 @@
document.getElementById('grantBtn').addEventListener('click', async () => {
const status = document.getElementById('status');
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
// Stop the tracks immediately since we only needed to ask for permission
stream.getTracks().forEach(track => track.stop());
status.style.color = '#00d67e';
status.textContent = '✅ تم منح الصلاحية بنجاح! يمكنك إغلاق هذه النافذة والعودة إلى الإضافة.';
// Auto close after 3 seconds
setTimeout(() => {
window.close();
}, 3000);
} catch (err) {
status.style.color = '#ff4d6d';
status.textContent = '❌ حدث خطأ أو تم رفض الصلاحية: ' + err.message;
}
});

View File

@@ -356,6 +356,7 @@ function initDictation() {
recognition.start(); recognition.start();
} catch (err) { } catch (err) {
statusEl.textContent = '❌ يجب السماح باستخدام الميكروفون'; statusEl.textContent = '❌ يجب السماح باستخدام الميكروفون';
chrome.tabs.create({ url: chrome.runtime.getURL('permission.html') });
} }
} }
}); });