2 * (C) Copyright 2007-2009 John J. Foerch
3 * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
5 * Use, modification, and distribution are subject to the terms specified in the
11 define_variable("daemon_quit_exits", true,
12 "This variable controls whether the `quit' command will exit "+
13 "the program or only close windows when daemon-mode is enabled. "+
14 "The default is true, meaning that the `quit' command will exit "+
17 function daemon_quit_hook_fn () {
18 if (daemon_quit_exits)
22 define_global_mode("daemon_mode",
23 function () { // enable
24 Cc["@mozilla.org/toolkit/app-startup;1"]
25 .getService(Ci.nsIAppStartup)
26 .enterLastWindowClosingSurvivalArea();
27 add_hook("quit_hook", daemon_quit_hook_fn);
29 function () { // disable
30 Cc["@mozilla.org/toolkit/app-startup;1"]
31 .getService(Ci.nsIAppStartup)
32 .exitLastWindowClosingSurvivalArea();
33 remove_hook("quit_hook", daemon_quit_hook_fn);
36 require_later("command-line.js");
38 call_after_load("command-line", function () {
39 command_line_handler("daemon", true, function () {
41 var window = make_chrome_window(conkeror_chrome_uri);
42 window.setTimeout(function () { window.close(); }, 0);