const activeButton = document.getElementById('ActiveButton'); const inactiveButton = document.getElementById('InactiveButton'); const timePicker = document.getElementById('TimePicker'); chrome.storage.local.get(['vaccineFinderActive', 'vaccineFinderTime'], (result) => { let active = result['vaccineFinderActive']; if (active === undefined) { chrome.storage.local.set({ vaccineFinderActive: false }); active = false; } if (active) { activeButton.style.display = 'block'; } else { inactiveButton.style.display = 'block'; } let time = result['vaccineFinderTime']; if (time === undefined) { chrome.storage.local.set({ vaccineFinderTime: '09:00' }); time = '09:00'; } timePicker.value = time; timePicker.oninput = () => { chrome.storage.local.set({ vaccineFinderTime: timePicker.value }); } }); activeButton.onclick = () => { activeButton.style.display = 'none'; inactiveButton.style.display = 'block'; chrome.storage.local.set({ vaccineFinderActive: false }); }; inactiveButton.onclick = () => { activeButton.style.display = 'block'; inactiveButton.style.display = 'none'; chrome.storage.local.set({ vaccineFinderActive: true }); };