diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index e5ccffb92..6e7d57bef 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -7,9 +7,47 @@ define([ 'jquery', ], function (nThen, ApiConfig, RequireConfig, Messages, $) { var common = {}; + var isSPAOuter = false; common.initIframe = function (waitFor, isRt, pathname) { var requireConfig = RequireConfig(); + var urlArgs = requireConfig.urlArgs; + var path = pathname || window.location.pathname; + + + // XXX + // * Add UI in settings + // * Note: if no shared worker on this machine, display a warning about performances + // * Reload a page + // * grep window.open in inner + if (localStorage.CP_SPA === "1") { + if (!window.parent || window.parent === window || window.parent.location.host !== window.location.host) { + // SPA enabled and we're in the upper level: init "outer" iframe + var worker = new SharedWorker('/common/outer/sharedworker.js?' + urlArgs); + var $i = $('