aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/content-script-main.js (renamed from ext/fg/js/frontend-initialize.js)6
-rw-r--r--ext/fg/js/float-main.js (renamed from ext/fg/js/popup-nested.js)9
-rw-r--r--ext/fg/js/float.js2
3 files changed, 9 insertions, 8 deletions
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/content-script-main.js
index 2df59e20..14285536 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/content-script-main.js
@@ -61,7 +61,7 @@ async function createPopupProxy(depth, id, parentFrameId, url) {
return popup;
}
-async function main() {
+(async () => {
await yomichan.prepare();
const data = window.frontendInitializationData || {};
@@ -128,6 +128,4 @@ async function main() {
window.addEventListener('fullscreenchange', applyOptions, false);
await applyOptions();
-}
-
-main();
+})();
diff --git a/ext/fg/js/popup-nested.js b/ext/fg/js/float-main.js
index c140f9c8..f056f707 100644
--- a/ext/fg/js/popup-nested.js
+++ b/ext/fg/js/float-main.js
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2020 Yomichan Authors
+ * Copyright (C) 2020 Yomichan Authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
*/
/* global
+ * DisplayFloat
* apiOptionsGet
*/
@@ -26,7 +27,7 @@ function injectPopupNested() {
'/fg/js/popup.js',
'/fg/js/popup-proxy.js',
'/fg/js/frontend.js',
- '/fg/js/frontend-initialize.js'
+ '/fg/js/content-script-main.js'
];
for (const src of scriptSrcs) {
const script = document.createElement('script');
@@ -65,3 +66,7 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) {
await applyOptions();
}
+
+(async () => {
+ new DisplayFloat();
+})();
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 5c2c50c2..18d15a72 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -189,5 +189,3 @@ class DisplayFloat extends Display {
}
}
}
-
-DisplayFloat.instance = new DisplayFloat();