(fireAt)
| 3859 | } |
| 3860 | |
| 3861 | async function ensureAutoRunTimerAlarm(fireAt) { |
| 3862 | if (!Number.isFinite(fireAt) || fireAt <= Date.now()) { |
| 3863 | return false; |
| 3864 | } |
| 3865 | |
| 3866 | const existingAlarm = await chrome.alarms.get(AUTO_RUN_TIMER_ALARM_NAME); |
| 3867 | if (!existingAlarm || Math.abs((existingAlarm.scheduledTime || 0) - fireAt) > 1000) { |
| 3868 | await chrome.alarms.clear(AUTO_RUN_TIMER_ALARM_NAME); |
| 3869 | await chrome.alarms.create(AUTO_RUN_TIMER_ALARM_NAME, { when: fireAt }); |
| 3870 | } |
| 3871 | |
| 3872 | return true; |
| 3873 | } |
| 3874 | |
| 3875 | async function clearAutoRunTimerAlarm() { |
| 3876 | await chrome.alarms.clear(AUTO_RUN_TIMER_ALARM_NAME); |
no outgoing calls
no test coverage detected