Merge pull request #2009 from deepak1556/webview_patch

override: set window.opener to null for webview
This commit is contained in:
Cheng Zhao 2015-06-23 10:03:40 +08:00
commit 2fca10ac98

View file

@ -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