aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-loader.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-loader.js')
-rw-r--r--modules/core/module-loader.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js
index a08a285..5d1c320 100644
--- a/modules/core/module-loader.js
+++ b/modules/core/module-loader.js
@@ -37,6 +37,11 @@
if (fill) fill.style.background = 'var(--error-color)';
}
+ // Create webx11 synchronously so critical-ext-bundle.js (loaded right after us)
+ // can call registerModule() without waiting for DOMContentLoaded
+ const webx11 = new WebX11Terminal();
+ window.webx11 = webx11;
+
async function init() {
try {
const total = 3;
@@ -46,12 +51,9 @@
setSplash('Critical ext bundle loaded (2/3)', ++count, total, 'critical-ext-bundle.js');
setSplash('Initializing terminal (3/3)', total, total, '');
- const webx11 = new WebX11Terminal();
- window.webx11 = webx11;
-
- // Optional ext modules via packages.json
+ // webx11 already created synchronously above — just init ext modules
if (typeof webx11._loadExtModules === 'function') {
- let extKeys = ['calc', 'voice', 'debug-panel', 'cron', 'theme', 'wpm', 'mindmap', 'webdav', 'skill-pack-core', 'cryptogzip', 'tutorial', 'floating', 'console'];
+ let extKeys = ['calc', 'voice', 'debug-panel', 'cron', 'theme', 'wpm', 'mindmap', 'webdav', 'skill-pack-core', 'cryptogzip', 'tutorial', 'floating', 'console', 'media'];
const saved = localStorage.getItem('webx11_startup_modules');
let selected = null;
try { if (saved) selected = JSON.parse(saved); } catch (e) {}