Auto-deploy: 2026-06-02 18:05:17
This commit is contained in:
@@ -70,7 +70,13 @@
|
||||
return; // offscreen script restarts it automatically
|
||||
}
|
||||
stopListening();
|
||||
showStatus('error', '❌ خطأ: ' + getArabicError(message.payload.error));
|
||||
|
||||
if (message.payload.error === 'not-allowed') {
|
||||
showStatus('error', '❌ الرجاء منح الصلاحية (تم فتح صفحة جديدة)');
|
||||
chrome.runtime.sendMessage({ type: 'OPEN_PERMISSION_PAGE' });
|
||||
} else {
|
||||
showStatus('error', '❌ خطأ: ' + getArabicError(message.payload.error));
|
||||
}
|
||||
} else if (message.type === 'OFFSCREEN_RECORDING_END') {
|
||||
if (isListening) {
|
||||
// Unexpected end from offscreen while we still consider ourselves listening
|
||||
|
||||
70
claude-arabic-voice/permission.html
Normal file
70
claude-arabic-voice/permission.html
Normal 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
claude-arabic-voice/permission.js
Normal file
19
claude-arabic-voice/permission.js
Normal 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 = '✅ تم منح الصلاحية بنجاح! يمكنك إغلاق هذه النافذة والعودة إلى Claude.';
|
||||
|
||||
// Auto close after 3 seconds
|
||||
setTimeout(() => {
|
||||
window.close();
|
||||
}, 3000);
|
||||
} catch (err) {
|
||||
status.style.color = '#ff4d6d';
|
||||
status.textContent = '❌ حدث خطأ أو تم رفض الصلاحية: ' + err.message;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user