mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Emit "exit" event for "process" when quitting.
This commit is contained in:
@@ -52,6 +52,10 @@ setImmediate ->
|
||||
detail: message
|
||||
buttons: ['OK']
|
||||
|
||||
# Emit 'exit' event on quit.
|
||||
require('app').on 'quit', ->
|
||||
process.emit 'exit'
|
||||
|
||||
# Load the RPC server.
|
||||
require './rpc-server.js'
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
|
||||
global.require = require
|
||||
global.module = module
|
||||
|
||||
# Emit the 'exit' event when page is unloading.
|
||||
window.addEventListener 'unload', ->
|
||||
process.emit 'exit'
|
||||
|
||||
# Set the __filename to the path of html file if it's file: or asar: protocol.
|
||||
if window.location.protocol in ['file:', 'asar:']
|
||||
pathname =
|
||||
|
||||
Reference in New Issue
Block a user