Skip to content

Commit

Permalink
feat: Sisyfos inside iFrame. Use window.top !== window.self to chech …
Browse files Browse the repository at this point in the history
…if it´s running inside something
  • Loading branch information
olzzons-mac authored and olzzons-mac committed Feb 11, 2020
1 parent bcc3633 commit 76ceca9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class App extends React.Component<IAppProps> {
}

sendSofieMessage(type: string, payload?: any | '', replyTo?: string | '') {
if (!window.frameElement) return;
window.top.postMessage({
id: Date.now().toString(),
replyToId: replyTo,
Expand All @@ -44,7 +43,7 @@ class App extends React.Component<IAppProps> {
}

iFrameFocusHandler() {
if (window.frameElement) {
if (window.top !== window.self) {
this.sendSofieMessage('hello')
document.addEventListener('click', (e) => {
e.preventDefault()
Expand Down

0 comments on commit 76ceca9

Please sign in to comment.