electron/spec/fixtures/module/preload-sandbox.js
2017-05-16 09:07:41 -03:00

15 lines
504 B
JavaScript

(function () {
const {setImmediate} = require('timers')
const {ipcRenderer} = require('electron')
window.ipcRenderer = ipcRenderer
window.setImmediate = setImmediate
window.require = require
if (location.protocol === 'file:') {
window.test = 'preload'
window.process = process
} else if (location.href !== 'about:blank') {
addEventListener('DOMContentLoaded', () => {
ipcRenderer.send('child-loaded', window.opener == null, document.body.innerHTML)
}, false)
}
})()