electron/spec/fixtures/module/preload-sandbox.js

14 lines
426 B
JavaScript
Raw Normal View History

2016-09-26 20:40:45 +00:00
(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)
}
})()