Switched to a listener map.

This commit is contained in:
Ajay Ramachandran
2020-01-07 22:59:50 -05:00
parent eb4bf89194
commit fa19e435cc
4 changed files with 193 additions and 134 deletions

View File

@@ -4,7 +4,9 @@ chrome.tabs.onUpdated.addListener(function(tabId) {
}, () => void chrome.runtime.lastError ); // Suppress error on Firefox
});
chrome.runtime.onMessage.addListener(function (request, sender, callback) {
chrome.runtime.onMessage.addListener(async function (request, sender, callback) {
await wait(() => SB.config !== undefined);
switch(request.message) {
case "submitTimes":
submitTimes(request.videoID, callback);