From d608d783b1a78ba1972c37ce283ee112e96a1056 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Thu, 25 Sep 2025 18:10:00 +0200 Subject: [PATCH] Working (do not look at code) --- www/webxdc/assets/index-legacy-CpC3q1r5.js | 1 + www/webxdc/inner.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/www/webxdc/assets/index-legacy-CpC3q1r5.js b/www/webxdc/assets/index-legacy-CpC3q1r5.js index f969d0c8a..65ee58150 100644 --- a/www/webxdc/assets/index-legacy-CpC3q1r5.js +++ b/www/webxdc/assets/index-legacy-CpC3q1r5.js @@ -7312,6 +7312,7 @@ console.log("XXX: loaded"); }), window.webxdc.setUpdateListener(ut, 0)); }; + window.chessOnload = onload; }, }; }); diff --git a/www/webxdc/inner.js b/www/webxdc/inner.js index b64b35fb0..717134b93 100644 --- a/www/webxdc/inner.js +++ b/www/webxdc/inner.js @@ -29,10 +29,23 @@ define([ return tag; } + function waitFor(contition, callback) { + if (contition()) { + callback(); + } else { + setTimeout(() => waitFor(contition, callback), 10); + } + } function loadChess() { const legacyTag = loadScript('vite-legacy-polyfill', '/webxdc/assets/polyfills-legacy-Op9eHCRg.js'); legacyTag.addEventListener('load', () => { System.import('/webxdc/assets/index-legacy-CpC3q1r5.js'); + waitFor(() => window.chessOnload, () => window.chessOnload()); + + // const legacyTag = loadScript('vite-legacy-entry', '/webxdc/assets/index-legacy-CpC3q1r5.js'); + // legacyTag.addEventListener('load', () => { + // window.chessOnload(); + // }); }); }