From cb1d9f60ecfb3454a875fb7074623303f5f5f6c2 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 18 Jun 2015 21:14:45 +0530 Subject: [PATCH] override: set window.opener to null for webview --- atom/renderer/lib/override.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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