feat: emit process 'loaded' event in sandboxed renderers (#17680)

This commit is contained in:
Milan Burda 2019-04-04 20:35:06 +02:00 committed by Samuel Attard
parent 127b87c713
commit 77d59e99b6
4 changed files with 25 additions and 4 deletions

View file

@ -56,6 +56,9 @@ v8Util.setHiddenValue(global, 'ipcNative', {
// AtomSandboxedRendererClient will look for the "lifecycle" hidden object when
v8Util.setHiddenValue(global, 'lifecycle', {
onLoaded () {
process.emit('loaded')
},
onExit () {
process.emit('exit')
},
@ -89,6 +92,7 @@ Object.defineProperty(preloadProcess, 'noDeprecation', {
}
})
process.on('loaded', () => preloadProcess.emit('loaded'))
process.on('exit', () => preloadProcess.emit('exit'))
// This is the `require` function that will be visible to the preload script