Suppress messages about unchecked runtime.lastError

This commit is contained in:
toasted-nutbread 2019-08-23 15:41:41 -04:00
parent 6c3671b3d9
commit a50ce724eb

View File

@ -57,9 +57,10 @@ class Backend {
this.anki = new AnkiNull();
}
const callback = () => this.checkLastError(chrome.runtime.lastError);
chrome.tabs.query({}, tabs => {
for (const tab of tabs) {
chrome.tabs.sendMessage(tab.id, {action: 'optionsSet', params: options}, () => null);
chrome.tabs.sendMessage(tab.id, {action: 'optionsSet', params: options}, callback);
}
});
}
@ -147,6 +148,10 @@ class Backend {
chrome.browserAction.setBadgeText({text});
}
}
checkLastError(e) {
// NOP
}
}
window.yomichan_backend = new Backend();