Only set window.opener for windows opened by window.open
This commit is contained in:
parent
039d4aaecb
commit
2a30520799
2 changed files with 4 additions and 1 deletions
|
@ -64,3 +64,6 @@ ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', (event, mess
|
||||||
|
|
||||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, guestId, method, args...) ->
|
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, guestId, method, args...) ->
|
||||||
BrowserWindow.fromId(guestId)?.webContents?[method] args...
|
BrowserWindow.fromId(guestId)?.webContents?[method] args...
|
||||||
|
|
||||||
|
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_IS_GUEST_WINDOW', (event) ->
|
||||||
|
event.returnValue = v8Util.getHiddenValue(event.sender, 'embedder') isnt undefined
|
||||||
|
|
|
@ -91,7 +91,7 @@ window.prompt = ->
|
||||||
throw new Error('prompt() is and will not be supported.')
|
throw new Error('prompt() is and will not be supported.')
|
||||||
|
|
||||||
# Simple implementation of postMessage.
|
# Simple implementation of postMessage.
|
||||||
unless process.guestInstanceId?
|
if ipc.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_IS_GUEST_WINDOW'
|
||||||
window.opener =
|
window.opener =
|
||||||
postMessage: (message, targetOrigin='*') ->
|
postMessage: (message, targetOrigin='*') ->
|
||||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin
|
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue