Add comment about window.opener tweaks
This commit is contained in:
parent
574eec3e74
commit
0ef0ce7345
1 changed files with 1 additions and 1 deletions
|
@ -91,10 +91,10 @@ window.confirm = (message, title='') ->
|
||||||
window.prompt = ->
|
window.prompt = ->
|
||||||
throw new Error('prompt() is and will not be supported.')
|
throw new Error('prompt() is and will not be supported.')
|
||||||
|
|
||||||
# Implement window.postMessage if current window is a guest window.
|
|
||||||
guestId = ipcRenderer.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_GET_GUEST_ID'
|
guestId = ipcRenderer.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_GET_GUEST_ID'
|
||||||
if guestId?
|
if guestId?
|
||||||
window.opener = BrowserWindowProxy.getOrCreate(guestId)
|
window.opener = BrowserWindowProxy.getOrCreate(guestId)
|
||||||
|
# Remove BrowserWindowProxy API and give it a custom postMessage method
|
||||||
Object.setPrototypeOf(window.opener, null)
|
Object.setPrototypeOf(window.opener, null)
|
||||||
window.opener.postMessage = (message, targetOrigin='*') ->
|
window.opener.postMessage = (message, targetOrigin='*') ->
|
||||||
ipcRenderer.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', guestId, message, targetOrigin, location.origin
|
ipcRenderer.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', guestId, message, targetOrigin, location.origin
|
||||||
|
|
Loading…
Reference in a new issue