From 0ef0ce73451c34fd8b6153132b6890b7ef47d6b4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 14 Dec 2015 14:57:38 -0800 Subject: [PATCH] Add comment about window.opener tweaks --- atom/renderer/lib/override.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/renderer/lib/override.coffee b/atom/renderer/lib/override.coffee index 3b741e004d3e..213dc497d0ce 100644 --- a/atom/renderer/lib/override.coffee +++ b/atom/renderer/lib/override.coffee @@ -91,10 +91,10 @@ window.confirm = (message, title='') -> window.prompt = -> 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' if guestId? window.opener = BrowserWindowProxy.getOrCreate(guestId) + # Remove BrowserWindowProxy API and give it a custom postMessage method Object.setPrototypeOf(window.opener, null) window.opener.postMessage = (message, targetOrigin='*') -> ipcRenderer.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', guestId, message, targetOrigin, location.origin