summaryrefslogtreecommitdiff
path: root/ext/js/yomichan.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/yomichan.js')
-rw-r--r--ext/js/yomichan.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/js/yomichan.js b/ext/js/yomichan.js
index 61301e30..7d101a4c 100644
--- a/ext/js/yomichan.js
+++ b/ext/js/yomichan.js
@@ -71,13 +71,13 @@ const yomichan = (() => {
return this._isExtensionUnloaded;
}
- prepare() {
+ async prepare(isBackground=false) {
chrome.runtime.onMessage.addListener(this._onMessage.bind(this));
- }
- backendReady() {
- this.sendMessage({action: 'requestBackendReadySignal'});
- return this._isBackendReadyPromise;
+ if (!isBackground) {
+ this.sendMessage({action: 'requestBackendReadySignal'});
+ await this._isBackendReadyPromise;
+ }
}
ready() {
@@ -302,5 +302,3 @@ const yomichan = (() => {
return new Yomichan();
})();
-
-yomichan.prepare();