Fix sending heartbeats and parsing GitHub repo

This commit is contained in:
Alan Hamlett
2024-08-30 10:33:13 +02:00
parent fb29f07e5e
commit 872161f655
5 changed files with 26 additions and 28 deletions

View File

@@ -40,6 +40,8 @@ chrome.runtime.onMessage.addListener(
return;
}
const heartbeat = site.parser(request.url);
sendResponse({ heartbeat: site.parser(request.url) });
}
},
@@ -50,6 +52,10 @@ document.body.addEventListener('click', sendHeartbeat, true);
document.body.addEventListener('keypress', sendHeartbeat, true);
const checkIfInAMeeting = () => {
if (!window.location.href.startsWith('https://meet.google.com/')) {
return;
}
const isActiveMeeting = !!document.querySelector('[data-meeting-title]');
if (isActiveMeeting) {
sendHeartbeat();
@@ -59,6 +65,4 @@ const checkIfInAMeeting = () => {
};
// Google Meet
if (window.location.href.startsWith('https://meet.google.com/')) {
checkIfInAMeeting();
}
checkIfInAMeeting();