Assert built-in prototype isolation
This commit is contained in:
parent
ad3b837ad5
commit
ea2273dde5
3 changed files with 14 additions and 4 deletions
|
@ -1845,13 +1845,17 @@ describe('BrowserWindow module', function () {
|
||||||
preloadProperty: 'number',
|
preloadProperty: 'number',
|
||||||
pageProperty: 'undefined',
|
pageProperty: 'undefined',
|
||||||
typeofRequire: 'function',
|
typeofRequire: 'function',
|
||||||
typeofProcess: 'object'
|
typeofProcess: 'object',
|
||||||
|
typeofArrayPush: 'function',
|
||||||
|
typeofFunctionApply: 'function',
|
||||||
},
|
},
|
||||||
pageContext: {
|
pageContext: {
|
||||||
preloadProperty: 'undefined',
|
preloadProperty: 'undefined',
|
||||||
pageProperty: 'string',
|
pageProperty: 'string',
|
||||||
typeofRequire: 'undefined',
|
typeofRequire: 'undefined',
|
||||||
typeofProcess: 'undefined'
|
typeofProcess: 'undefined',
|
||||||
|
typeofArrayPush: 'number',
|
||||||
|
typeofFunctionApply: 'boolean',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
done()
|
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,
|
preloadProperty: typeof window.foo,
|
||||||
pageProperty: typeof window.hello,
|
pageProperty: typeof window.hello,
|
||||||
typeofRequire: typeof require,
|
typeofRequire: typeof require,
|
||||||
typeofProcess: typeof process
|
typeofProcess: typeof process,
|
||||||
|
typeofArrayPush: typeof Array.prototype.push,
|
||||||
|
typeofFunctionApply: typeof Function.prototype.apply
|
||||||
},
|
},
|
||||||
pageContext: event.data
|
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>
|
<title>Isolated World</title>
|
||||||
<script>
|
<script>
|
||||||
window.hello = 'world'
|
window.hello = 'world'
|
||||||
|
Array.prototype.push = 3
|
||||||
|
Function.prototype.apply = true
|
||||||
window.postMessage({
|
window.postMessage({
|
||||||
preloadProperty: typeof window.foo,
|
preloadProperty: typeof window.foo,
|
||||||
pageProperty: typeof window.hello,
|
pageProperty: typeof window.hello,
|
||||||
typeofRequire: typeof require,
|
typeofRequire: typeof require,
|
||||||
typeofProcess: typeof process
|
typeofProcess: typeof process,
|
||||||
|
typeofArrayPush: typeof Array.prototype.push,
|
||||||
|
typeofFunctionApply: typeof Function.prototype.apply
|
||||||
}, '*')
|
}, '*')
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue