Add some tests for "sandbox" option
This commit is contained in:
parent
a64978b812
commit
47fd41715f
3 changed files with 282 additions and 0 deletions
13
spec/fixtures/module/preload-sandbox.js
vendored
Normal file
13
spec/fixtures/module/preload-sandbox.js
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
(function () {
|
||||
const {ipcRenderer} = require('electron')
|
||||
window.ipcRenderer = ipcRenderer
|
||||
if (location.protocol === 'file:') {
|
||||
window.test = 'preload'
|
||||
window.require = require
|
||||
window.process = process
|
||||
} else if (location.href !== 'about:blank') {
|
||||
addEventListener('DOMContentLoaded', () => {
|
||||
ipcRenderer.send('child-loaded', window.opener == null, document.body.innerHTML)
|
||||
}, false)
|
||||
}
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue