electron/spec/fixtures/module/preload-sandbox.js
Thiago de Arruda 5ee6205c0a Run the crash reporter specs with sandbox option.
- Create a function that accepts BrowserWindow options and generates a suite
  that contains the renderer-specific tests.
- Run the function twice to execute the tests with and without sandbox option.
2017-03-23 10:01:02 -03:00

15 lines
506 B
JavaScript

(function () {
const {setImmediate} = require('timers')
const {ipcRenderer} = require('electron')
window.ipcRenderer = ipcRenderer
window.setImmediate = setImmediate
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)
}
})()