From 552c0f52510cf1f1c96db98b9f795c48a36e744b Mon Sep 17 00:00:00 2001 From: keeper1978 Date: Tue, 3 Mar 2026 11:19:15 +0300 Subject: [PATCH] chore(plugin): align startup principle with appready/listener manifest-safe init --- porn365.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/porn365.js b/porn365.js index 8354422..3d6a359 100644 --- a/porn365.js +++ b/porn365.js @@ -240,6 +240,9 @@ function start() { try { + // Принцип как у surs.js: запуск после готовности приложения + ветка по версии Lampa + var appDigital = (window.Lampa && Lampa.Manifest && Lampa.Manifest.app_digital) ? Number(Lampa.Manifest.app_digital) : 0; + log('Lampa app_digital=' + appDigital); mountUi(); } catch (e) { log('Start error: ' + (e && e.message ? e.message : e)); @@ -253,6 +256,9 @@ if (e && e.type === 'ready') start(); }); } else { - window.addEventListener('load', start); + // fallback, чтобы не падать в старых оболочках + window.addEventListener('load', function () { + setTimeout(start, 300); + }); } })();