diff options
author | Alex Yatskov <alex@foosoft.net> | 2020-06-27 19:04:19 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2020-06-27 19:04:19 -0700 |
commit | 88af95d20bfdbeb59d44bf0f0d46e772a329f839 (patch) | |
tree | d1dfa7268f274fed32061221c0f030e3647f9ae2 /ext/bg/js/background-main.js | |
parent | 19197a9a5d6a1f54a179d894577dfac513b97401 (diff) | |
parent | 0a6c08d0f53090a4ad48663bc5846ddae5723d52 (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/bg/js/background-main.js')
-rw-r--r-- | ext/bg/js/background-main.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/bg/js/background-main.js b/ext/bg/js/background-main.js index 24117f4e..9dd447c4 100644 --- a/ext/bg/js/background-main.js +++ b/ext/bg/js/background-main.js @@ -17,9 +17,15 @@ /* global * Backend + * BackendEventHandler */ -(async () => { - window.yomichanBackend = new Backend(); - await window.yomichanBackend.prepare(); +(() => { + const backend = new Backend(); + const backendEventHandler = new BackendEventHandler(backend); + backendEventHandler.prepare(); + if (typeof window === 'object' && window !== null) { + window.yomichanBackend = backend; + } + backend.prepare(); })(); |