diff --git a/front/src/Api/IframeListener.ts b/front/src/Api/IframeListener.ts index c875ebbb..3479a454 100644 --- a/front/src/Api/IframeListener.ts +++ b/front/src/Api/IframeListener.ts @@ -86,8 +86,12 @@ class IframeListener { else if(payload.type === 'goToPage' && isGoToPageEvent(payload.data)) { scriptUtils.goToPage(payload.data.url); } - else if(payload.type === 'openCoWebSite' && isOpenCoWebsite(payload.data)) { - scriptUtils.openCoWebsite(payload.data.url); + else if (payload.type === 'openCoWebSite' && isOpenCoWebsite(payload.data)) { + const scriptUrl = [...this.scripts.keys()].find(key => { + return this.scripts.get(key)?.contentWindow == message.source + }) + + scriptUtils.openCoWebsite(payload.data.url, scriptUrl || payload.data.url); } else if(payload.type === 'closeCoWebSite') { scriptUtils.closeCoWebSite(); diff --git a/front/src/Api/ScriptUtils.ts b/front/src/Api/ScriptUtils.ts index 1a7fed0f..8a5cb2c9 100644 --- a/front/src/Api/ScriptUtils.ts +++ b/front/src/Api/ScriptUtils.ts @@ -11,8 +11,7 @@ class ScriptUtils { } - public openCoWebsite(url : string){ - coWebsiteManager.loadCoWebsite(url,url); + public openCoWebsite(url: string, base: string) { } public closeCoWebSite(){