electron/lib/isolated_renderer/init.js

26 lines
643 B
JavaScript
Raw Normal View History

'use strict'
/* global binding */
2018-09-13 16:10:51 +00:00
const { send, sendSync } = binding
const ipcRenderer = {
send (...args) {
return send('ipc-internal-message', args)
},
sendSync (...args) {
return sendSync('ipc-internal-message-sync', args)[0]
},
// No-ops since events aren't received
on () {},
once () {}
}
2018-09-13 16:10:51 +00:00
let { guestInstanceId, hiddenPage, openerId, nativeWindowOpen } = binding
if (guestInstanceId != null) guestInstanceId = parseInt(guestInstanceId)
if (openerId != null) openerId = parseInt(openerId)
require('@electron/internal/renderer/window-setup')(ipcRenderer, guestInstanceId, openerId, hiddenPage, nativeWindowOpen)