From a50ce724eb70f54f8e62207ec2630997967f36d7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 23 Aug 2019 15:41:41 -0400 Subject: Suppress messages about unchecked runtime.lastError --- ext/bg/js/backend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/bg') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index d49286d0..d95cb82d 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -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(); -- cgit v1.2.3