aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-23 18:26:34 -0400
committerGitHub <noreply@github.com>2020-04-23 18:26:34 -0400
commit9216d1862fa8d0f51fe1dba603c2643aa8ef4215 (patch)
tree74f99b338dae8ecf6737eb3c9a234c26abed419a /ext/fg/js
parent6a39b0cd7a5f3145300fe48942b55122734ae0a5 (diff)
parentd8276a9d5d119edf1747593608d3e135947019f0 (diff)
Merge pull request #463 from toasted-nutbread/explicit-entry-point
Explicit entry points
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();