From 09710d6c4766415d9030b1b2532f1de153a103e0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Mar 2016 13:37:57 -0700 Subject: [PATCH] Don't quit on window-all-closed when in repl mode --- default_app/main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/default_app/main.js b/default_app/main.js index 683dccaf3e16..c46d1fc3bd6b 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -9,12 +9,6 @@ const path = require('path'); const repl = require('repl'); const url = require('url'); -// Quit when all windows are closed and no other one is listening to this. -app.on('window-all-closed', function() { - if (app.listeners('window-all-closed').length == 1) - app.quit(); -}); - // Parse command line options. var argv = process.argv.slice(1); var option = { file: null, help: null, version: null, webdriver: null, modules: [] }; @@ -43,6 +37,12 @@ for (var i = 0; i < argv.length; i++) { } } +// Quit when all windows are closed and no other one is listening to this. +app.on('window-all-closed', function() { + if (app.listeners('window-all-closed').length == 1 && !option.interactive) + app.quit(); +}); + // Create default menu. app.once('ready', function() { if (Menu.getApplicationMenu())