Skip to content

Commit

Permalink
wait for backend ready signal to prepare cross-frame api
Browse files Browse the repository at this point in the history
not sure if API messages should be sent in prepare(), but we should
probably wait for the ready signal before doing so
  • Loading branch information
praschke committed Oct 1, 2023
1 parent be46fb6 commit 841d49c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/js/yomichan.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ class Yomichan extends EventDispatcher {
if (!isBackground) {
this._api = new API(this);

this._crossFrame = new CrossFrameAPI();
this._crossFrame.prepare();

this.sendMessage({action: 'requestBackendReadySignal'});
await this._isBackendReadyPromise;

this._crossFrame = new CrossFrameAPI();
await this._crossFrame.prepare();

log.on('log', this._onForwardLog.bind(this));
}
}
Expand Down

0 comments on commit 841d49c

Please sign in to comment.