aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 3226dd9c..04bf240d 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -120,7 +120,8 @@ class Backend {
this.clipboardMonitor.on('change', this._onClipboardText.bind(this));
this._sendMessageAllTabs('backendPrepared');
- chrome.runtime.sendMessage({action: 'backendPrepared'});
+ const callback = () => this.checkLastError(chrome.runtime.lastError);
+ chrome.runtime.sendMessage({action: 'backendPrepared'}, callback);
}
_sendMessageAllTabs(action, params={}) {
@@ -281,7 +282,8 @@ class Backend {
_onApiYomichanCoreReady(_params, sender) {
// tab ID isn't set in background (e.g. browser_action)
if (typeof sender.tab === 'undefined') {
- chrome.runtime.sendMessage({action: 'backendPrepared'});
+ const callback = () => this.checkLastError(chrome.runtime.lastError);
+ chrome.runtime.sendMessage({action: 'backendPrepared'}, callback);
return Promise.resolve();
}