var startTime = '18:13';
var today = new Date();
var currentTime = today.getHours() + ":" + today.getMinutes();
var meetLink = 'https://meet.google.com/rnc-akmx-ubk';
if (currentTime == startTime) {
joinMeeting();
}
function joinMeeting() {
location.href = meetLink;
setTimeout(turnOffMicVideo, 10000);
}
function turnOffMicVideo() {
var videoElements = document.getElementsByClassName('I5fjHe');
var micElements = document.getElementsByClassName('oTVIqe');
for (var i = 0; i < videoElements.length; i++) {
videoElements[i].click();
}
for (var i = 0; i < micElements.length; i++) {
micElements[i].click();
}
}
An automated extension to join a Google Meet session at a specific time. However, there is an issue with the repeated execution of the function inside the if statement every second until it matches the condition. Any suggestions on how to ensure the function runs only once?