Only set window.opener for windows opened by window.open

This commit is contained in:
Cheng Zhao 2015-08-04 15:47:12 +08:00
parent 039d4aaecb
commit 2a30520799
2 changed files with 4 additions and 1 deletions

View file

@ -91,7 +91,7 @@ window.prompt = ->
throw new Error('prompt() is and will not be supported.')
# Simple implementation of postMessage.
unless process.guestInstanceId?
if ipc.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_IS_GUEST_WINDOW'
window.opener =
postMessage: (message, targetOrigin='*') ->
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin