Auto-deploy: 2026-06-02 18:31:11
This commit is contained in:
19
permission.js
Normal file
19
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 = '✅ تم منح الصلاحية بنجاح! يمكنك إغلاق هذه النافذة والعودة إلى الإضافة.';
|
||||
|
||||
// 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