Emit "exit" event for "process" when quitting.
This commit is contained in:
parent
909ff085ac
commit
d559275711
2 changed files with 8 additions and 0 deletions
|
@ -52,6 +52,10 @@ setImmediate ->
|
||||||
detail: message
|
detail: message
|
||||||
buttons: ['OK']
|
buttons: ['OK']
|
||||||
|
|
||||||
|
# Emit 'exit' event on quit.
|
||||||
|
require('app').on 'quit', ->
|
||||||
|
process.emit 'exit'
|
||||||
|
|
||||||
# Load the RPC server.
|
# Load the RPC server.
|
||||||
require './rpc-server.js'
|
require './rpc-server.js'
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
|
||||||
global.require = require
|
global.require = require
|
||||||
global.module = module
|
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.
|
# Set the __filename to the path of html file if it's file: or asar: protocol.
|
||||||
if window.location.protocol in ['file:', 'asar:']
|
if window.location.protocol in ['file:', 'asar:']
|
||||||
pathname =
|
pathname =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue