diff --git a/module/index/js/index.ui.js b/module/index/js/index.ui.js index 12429204ac..cf1417119e 100644 --- a/module/index/js/index.ui.js +++ b/module/index/js/index.ui.js @@ -112,7 +112,7 @@ function openApp(url, code, options) 'name="app-' + code + '"', 'class="fade"', 'allowfullscreen="true"', - 'src="' + $.createLink('index', 'app', 'url=' + btoa(url)) + '"', + 'src="' + $.createLink('index', 'app') + '"', 'frameborder="no"', 'allowtransparency="true"', 'scrolling="auto"', @@ -124,6 +124,10 @@ function openApp(url, code, options) .append($iframe) .appendTo('#apps'); + $iframe.on('ready.app', () => + { + openApp(url, code, options); + }); iframe.onload = iframe.onreadystatechange = function(e) { const finishLoad = () => $iframe.removeClass('loading').addClass('in'); @@ -131,6 +135,7 @@ function openApp(url, code, options) setTimeout(finishLoad, 10000); triggerAppEvent(openedApp.code, 'loadapp', [openedApp, e]); }; + return; } if(!url) url = openedApp.currentUrl; diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index fdfff96c66..329d670aae 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -874,11 +874,14 @@ { initZinbar(); - if(window.defaultAppUrl) + if(window.defaultAppUrl) loadPage(window.defaultAppUrl); + if(isInAppTab) { - loadPage(window.defaultAppUrl); + const frameElement = window.frameElement; + if(frameElement && parent.window.$) parent.window.$(frameElement).trigger('ready.app'); } - else if(DEBUG) + + if(DEBUG) { if(window.zinDebug) {