Use ipcRenderer in Electron's code
This commit is contained in:
parent
828d911ed1
commit
6515a445a0
20 changed files with 32 additions and 34 deletions
|
@ -1,4 +1,4 @@
|
|||
ipc = require 'ipc'
|
||||
ipc = require 'ipc-renderer'
|
||||
remote = require 'remote'
|
||||
|
||||
# Helper function to resolve relative url.
|
||||
|
@ -11,7 +11,7 @@ resolveUrl = (url) ->
|
|||
class BrowserWindowProxy
|
||||
constructor: (@guestId) ->
|
||||
@closed = false
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSED', (guestId) =>
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSED', (event, guestId) =>
|
||||
if guestId is @guestId
|
||||
@closed = true
|
||||
|
||||
|
@ -99,7 +99,7 @@ if guestId?
|
|||
postMessage: (message, targetOrigin='*') ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', guestId, message, targetOrigin, location.origin
|
||||
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', (guestId, message, sourceOrigin) ->
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', (event, guestId, message, sourceOrigin) ->
|
||||
# Manually dispatch event instead of using postMessage because we also need to
|
||||
# set event.source.
|
||||
event = document.createEvent 'Event'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue