electron/spec/fixtures/api/isolated-preload.js

18 lines
479 B
JavaScript
Raw Normal View History

2016-12-13 19:47:54 +00:00
const {ipcRenderer} = require('electron')
window.foo = 3
window.addEventListener('message', (event) => {
ipcRenderer.send('isolated-world', {
preloadContext: {
preloadProperty: typeof window.foo,
pageProperty: typeof window.hello,
typeofRequire: typeof require,
2016-12-15 23:23:45 +00:00
typeofProcess: typeof process,
typeofArrayPush: typeof Array.prototype.push,
typeofFunctionApply: typeof Function.prototype.apply
2016-12-13 19:47:54 +00:00
},
pageContext: event.data
})
})