This commit is contained in:
2021-11-22 20:07:06 +01:00
parent ee29c0b25b
commit 1acc0d4244
17 changed files with 275 additions and 163 deletions

View File

@@ -48,5 +48,11 @@ setInterval(deleteOldLogs, 5 * 60 * 1000) // Delete old logs every 5 minutes
setInterval(log, frequency)
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
return getUsageForHost(message).then((percentages) => percentagesToBool(percentages))
switch (message.type) {
case 'check':
return getUsageForHost(message.host).then((percentages) => percentagesToBool(percentages))
case 'report':
DB.settings.put({ key: 'lastActivity', value: new Date() })
break
}
})