diff --git a/atom/renderer/lib/override.coffee b/atom/renderer/lib/override.coffee index 2e25ffbd6b43..4c2b64a816e0 100644 --- a/atom/renderer/lib/override.coffee +++ b/atom/renderer/lib/override.coffee @@ -76,9 +76,10 @@ window.prompt = -> throw new Error('prompt() is and will not be supported.') # Simple implementation of postMessage. -window.opener = - postMessage: (message, targetOrigin='*') -> - ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin +unless process.guestInstanceId? + window.opener = + postMessage: (message, targetOrigin='*') -> + ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin ipc.on 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', (message, targetOrigin) -> window.postMessage message, targetOrigin