-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
24 lines (22 loc) · 930 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
document.addEventListener('DOMContentLoaded', function() {
function updateAttendeeList() {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, {action: "getAttendees"}, function(response) {
if (response && response.attendees) {
const attendeeList = document.getElementById('attendeeList');
attendeeList.innerHTML = '';
response.attendees.forEach(name => {
const li = document.createElement('li');
li.textContent = name;
attendeeList.appendChild(li);
});
}
});
});
}
updateAttendeeList();
setInterval(updateAttendeeList, 5000); // Update every 5 seconds
document.getElementById('downloadBtn').addEventListener('click', function() {
chrome.runtime.sendMessage({action: "downloadAttendance"});
});
});