From 76ceca9a193ae2025b649bef83a669879eac952e Mon Sep 17 00:00:00 2001 From: olzzons-mac Date: Tue, 11 Feb 2020 12:47:42 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Sisyfos=20inside=20iFrame.=20Use=20wind?= =?UTF-8?q?ow.top=20!=3D=3D=20window.self=20to=20chech=20if=20it=C2=B4s=20?= =?UTF-8?q?running=20inside=20something?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/App.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/components/App.tsx b/client/components/App.tsx index 9e7a5877..85ea2cea 100644 --- a/client/components/App.tsx +++ b/client/components/App.tsx @@ -34,7 +34,6 @@ class App extends React.Component { } sendSofieMessage(type: string, payload?: any | '', replyTo?: string | '') { - if (!window.frameElement) return; window.top.postMessage({ id: Date.now().toString(), replyToId: replyTo, @@ -44,7 +43,7 @@ class App extends React.Component { } iFrameFocusHandler() { - if (window.frameElement) { + if (window.top !== window.self) { this.sendSofieMessage('hello') document.addEventListener('click', (e) => { e.preventDefault()