mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Assert built-in prototype isolation
This commit is contained in:
@@ -1845,13 +1845,17 @@ describe('BrowserWindow module', function () {
|
||||
preloadProperty: 'number',
|
||||
pageProperty: 'undefined',
|
||||
typeofRequire: 'function',
|
||||
typeofProcess: 'object'
|
||||
typeofProcess: 'object',
|
||||
typeofArrayPush: 'function',
|
||||
typeofFunctionApply: 'function',
|
||||
},
|
||||
pageContext: {
|
||||
preloadProperty: 'undefined',
|
||||
pageProperty: 'string',
|
||||
typeofRequire: 'undefined',
|
||||
typeofProcess: 'undefined'
|
||||
typeofProcess: 'undefined',
|
||||
typeofArrayPush: 'number',
|
||||
typeofFunctionApply: 'boolean',
|
||||
}
|
||||
})
|
||||
done()
|
||||
|
||||
4
spec/fixtures/api/isolated-preload.js
vendored
4
spec/fixtures/api/isolated-preload.js
vendored
@@ -8,7 +8,9 @@ window.addEventListener('message', (event) => {
|
||||
preloadProperty: typeof window.foo,
|
||||
pageProperty: typeof window.hello,
|
||||
typeofRequire: typeof require,
|
||||
typeofProcess: typeof process
|
||||
typeofProcess: typeof process,
|
||||
typeofArrayPush: typeof Array.prototype.push,
|
||||
typeofFunctionApply: typeof Function.prototype.apply
|
||||
},
|
||||
pageContext: event.data
|
||||
})
|
||||
|
||||
6
spec/fixtures/api/isolated.html
vendored
6
spec/fixtures/api/isolated.html
vendored
@@ -5,11 +5,15 @@
|
||||
<title>Isolated World</title>
|
||||
<script>
|
||||
window.hello = 'world'
|
||||
Array.prototype.push = 3
|
||||
Function.prototype.apply = true
|
||||
window.postMessage({
|
||||
preloadProperty: typeof window.foo,
|
||||
pageProperty: typeof window.hello,
|
||||
typeofRequire: typeof require,
|
||||
typeofProcess: typeof process
|
||||
typeofProcess: typeof process,
|
||||
typeofArrayPush: typeof Array.prototype.push,
|
||||
typeofFunctionApply: typeof Function.prototype.apply
|
||||
}, '*')
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user