2017-01-12 00:36:59 +00:00
|
|
|
/* global binding */
|
|
|
|
|
|
|
|
'use strict'
|
|
|
|
|
2017-01-12 21:28:48 +00:00
|
|
|
const {send, sendSync} = binding
|
2017-01-12 00:36:59 +00:00
|
|
|
const {parse} = JSON
|
|
|
|
|
|
|
|
const ipcRenderer = {
|
|
|
|
send (...args) {
|
|
|
|
return send('ipc-message', args)
|
|
|
|
},
|
|
|
|
|
|
|
|
sendSync (...args) {
|
|
|
|
return parse(sendSync('ipc-message-sync', args))
|
|
|
|
},
|
|
|
|
|
|
|
|
// No-ops since events aren't received
|
|
|
|
on () {},
|
|
|
|
once () {}
|
|
|
|
}
|
|
|
|
|
2017-01-12 21:28:48 +00:00
|
|
|
let {guestInstanceId, hiddenPage, openerId} = binding
|
|
|
|
if (guestInstanceId != null) guestInstanceId = parseInt(guestInstanceId)
|
|
|
|
if (openerId != null) openerId = parseInt(openerId)
|
|
|
|
|
2017-01-12 00:36:59 +00:00
|
|
|
require('../renderer/window-setup')(ipcRenderer, guestInstanceId, openerId, hiddenPage)
|