chore: refactor context isolation spec (#14394)

* spec: refactor BrowserWindow module contextIsolation option

* spec: check for serialzation in isolated renderers separately
This commit is contained in:
Robo 2018-09-01 02:21:29 +05:30 committed by Samuel Attard
parent 3a79eacb6f
commit 32158ca5dd
5 changed files with 63 additions and 59 deletions

View file

@ -1,7 +1,3 @@
// Ensure fetch works from isolated world origin
fetch('http://localhost:1234')
fetch('https://localhost:1234')
const {ipcRenderer, webFrame} = require('electron')
window.foo = 3
@ -16,18 +12,8 @@ window.addEventListener('message', (event) => {
typeofRequire: typeof require,
typeofProcess: typeof process,
typeofArrayPush: typeof Array.prototype.push,
typeofFunctionApply: typeof Function.prototype.apply
},
pageContext: event.data
})
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
typeofFunctionApply: typeof Function.prototype.apply,
typeofPreloadExecuteJavaScriptProperty: typeof window.preloadExecuteJavaScriptProperty
},
pageContext: event.data
})