summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-22 21:42:20 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-22 21:42:20 -0400
commitd8276a9d5d119edf1747593608d3e135947019f0 (patch)
tree455373d756a1759582bbdd9b9d69d7eb7d8e220c /ext/fg
parentd106c638ed69b2c72895c1040b0e7bea2e31cdb7 (diff)
Use IIFE for entry points
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/content-script-main.js6
-rw-r--r--ext/fg/js/float-main.js6
2 files changed, 4 insertions, 8 deletions
diff --git a/ext/fg/js/content-script-main.js b/ext/fg/js/content-script-main.js
index 974320cc..14285536 100644
--- a/ext/fg/js/content-script-main.js
+++ b/ext/fg/js/content-script-main.js
@@ -61,7 +61,7 @@ async function createPopupProxy(depth, id, parentFrameId, url) {
return popup;
}
-async function contentScriptMain() {
+(async () => {
await yomichan.prepare();
const data = window.frontendInitializationData || {};
@@ -128,6 +128,4 @@ async function contentScriptMain() {
window.addEventListener('fullscreenchange', applyOptions, false);
await applyOptions();
-}
-
-contentScriptMain();
+})();
diff --git a/ext/fg/js/float-main.js b/ext/fg/js/float-main.js
index 072c86e0..f056f707 100644
--- a/ext/fg/js/float-main.js
+++ b/ext/fg/js/float-main.js
@@ -67,8 +67,6 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) {
await applyOptions();
}
-async function main() {
+(async () => {
new DisplayFloat();
-}
-
-main();
+})();