Use IIFE for entry points
This commit is contained in:
parent
d106c638ed
commit
d8276a9d5d
@ -19,9 +19,7 @@
|
||||
* Backend
|
||||
*/
|
||||
|
||||
async function main() {
|
||||
(async () => {
|
||||
window.yomichanBackend = new Backend();
|
||||
await window.yomichanBackend.prepare();
|
||||
}
|
||||
|
||||
main();
|
||||
})();
|
||||
|
@ -88,8 +88,6 @@ async function mainInner() {
|
||||
});
|
||||
}
|
||||
|
||||
async function main() {
|
||||
(async () => {
|
||||
window.addEventListener('DOMContentLoaded', mainInner, false);
|
||||
}
|
||||
|
||||
main();
|
||||
})();
|
||||
|
@ -52,7 +52,7 @@ function injectSearchFrontend() {
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
(async () => {
|
||||
await yomichan.prepare();
|
||||
|
||||
const displaySearch = new DisplaySearch();
|
||||
@ -78,6 +78,4 @@ async function main() {
|
||||
yomichan.on('optionsUpdated', applyOptions);
|
||||
|
||||
await applyOptions();
|
||||
}
|
||||
|
||||
main();
|
||||
})();
|
||||
|
@ -19,9 +19,7 @@
|
||||
* SettingsPopupPreview
|
||||
*/
|
||||
|
||||
async function main() {
|
||||
(async () => {
|
||||
const instance = new SettingsPopupPreview();
|
||||
await instance.prepare();
|
||||
}
|
||||
|
||||
main();
|
||||
})();
|
||||
|
@ -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();
|
||||
})();
|
||||
|
@ -67,8 +67,6 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) {
|
||||
await applyOptions();
|
||||
}
|
||||
|
||||
async function main() {
|
||||
(async () => {
|
||||
new DisplayFloat();
|
||||
}
|
||||
|
||||
main();
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user