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