2017-03-01 08:48:03 -08:00
|
|
|
// Ensure fetch works from isolated world origin
|
|
|
|
fetch('http://localhost:1234')
|
|
|
|
fetch('https://localhost:1234')
|
|
|
|
|
2017-01-05 09:33:54 -08:00
|
|
|
const {ipcRenderer, webFrame} = require('electron')
|
2016-12-13 11:47:54 -08:00
|
|
|
|
|
|
|
window.foo = 3
|
|
|
|
|
2017-08-08 16:19:18 -07:00
|
|
|
webFrame.executeJavaScript('window.preloadExecuteJavaScriptProperty = 1234;')
|
|
|
|
|
2016-12-13 11:47:54 -08:00
|
|
|
window.addEventListener('message', (event) => {
|
|
|
|
ipcRenderer.send('isolated-world', {
|
|
|
|
preloadContext: {
|
|
|
|
preloadProperty: typeof window.foo,
|
|
|
|
pageProperty: typeof window.hello,
|
|
|
|
typeofRequire: typeof require,
|
2016-12-15 15:23:45 -08:00
|
|
|
typeofProcess: typeof process,
|
|
|
|
typeofArrayPush: typeof Array.prototype.push,
|
|
|
|
typeofFunctionApply: typeof Function.prototype.apply
|
2016-12-13 11:47:54 -08:00
|
|
|
},
|
|
|
|
pageContext: event.data
|
|
|
|
})
|
2017-07-27 17:08:24 -07:00
|
|
|
ipcRenderer.send('isolated-sandbox-world', {
|
|
|
|
preloadContext: {
|
|
|
|
preloadProperty: typeof window.foo,
|
|
|
|
pageProperty: typeof window.hello,
|
|
|
|
typeofRequire: typeof require,
|
|
|
|
typeofProcess: typeof process,
|
|
|
|
typeofArrayPush: typeof Array.prototype.push,
|
|
|
|
typeofFunctionApply: typeof Function.prototype.apply
|
|
|
|
},
|
|
|
|
pageContext: event.data
|
|
|
|
})
|
2016-12-13 11:47:54 -08:00
|
|
|
})
|