aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/Application.ts8
-rw-r--r--src/content/index.ts14
2 files changed, 12 insertions, 10 deletions
diff --git a/src/content/Application.ts b/src/content/Application.ts
index 7c8e588..b09edfa 100644
--- a/src/content/Application.ts
+++ b/src/content/Application.ts
@@ -36,12 +36,12 @@ export default class Application {
private navigateController: NavigateController
) {}
- run() {
- this.routeCommonComponents();
+ init(): Promise<void> {
this.routeFocusEvents();
if (window.self === window.top) {
this.routeMasterComponents();
}
+ return this.routeCommonComponents();
}
private routeMasterComponents() {
@@ -76,7 +76,7 @@ export default class Application {
});
}
- private routeCommonComponents() {
+ private routeCommonComponents(): Promise<void> {
this.messageListener.onWebMessage((msg: Message) => {
switch (msg.type) {
case messages.FOLLOW_REQUEST_COUNT_TARGETS:
@@ -117,7 +117,7 @@ export default class Application {
inputDriver.onKey((key) => this.markKeyController.press(key));
inputDriver.onKey((key) => this.keymapController.press(key));
- this.settingController.initSettings();
+ return this.settingController.initSettings();
}
private routeFocusEvents() {
diff --git a/src/content/index.ts b/src/content/index.ts
index 20dbbcc..82f3a4c 100644
--- a/src/content/index.ts
+++ b/src/content/index.ts
@@ -7,12 +7,14 @@ import { container } from "tsyringe";
import "./di";
const initDom = () => {
- try {
- const app = container.resolve(Application);
- app.run();
- } catch (e) {
- console.error(e);
- }
+ (async () => {
+ try {
+ const app = container.resolve(Application);
+ await app.init();
+ } catch (e) {
+ console.error(e);
+ }
+ })();
const style = window.document.createElement("style");
style.textContent = consoleFrameStyle;