2 * (C) Copyright 2004-2007 Shawn Betts
3 * (C) Copyright 2007-2010 John J. Foerch
4 * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
6 * Use, modification, and distribution are subject to the terms specified in the
10 let (default_rc = get_home_directory()) {
11 default_rc.appendRelativePath(".conkerorrc");
12 default_pref("conkeror.rcfile", default_rc.path);
17 var rcfile = get_pref("conkeror.rcfile");
18 if (rcfile.length == 0)
19 //FIXME: log that the rc is disabled
21 path = make_file(rcfile);
22 if (! path.exists()) {
24 dumpln("w: broken symlink, \""+rcfile+"\"");
25 else if (pref_has_user_value("conkeror.rcfile"))
26 dumpln("w: preference conkeror.rcfile is set to "+
27 "non-existent path, \""+rcfile+"\"");
28 //FIXME: else log that the rc does not exist
33 if (path.isDirectory()) {
34 var entries = path.directoryEntries;
35 while (entries.hasMoreElements()) {
36 var entry = entries.getNext();
37 entry.QueryInterface(Ci.nsIFile);
38 if (entry.leafName.substr(-3).toLowerCase() == '.js')
41 files.sort(function (a, b) {
42 if (a.leafName < b.leafName)
44 else if (a.leafName > b.leafName)
49 path.appendRelativePath("a");
50 ret = path.path.substr(0, path.path.length - 1) + "*.js";
55 var obs = Cc["@mozilla.org/observer-service;1"]
56 .getService(Ci.nsIObserverService);
57 obs.notifyObservers(null, "startupcache-invalidate", null);
58 for (var i = 0; files[i]; i++) {
65 //FIXME: log what was loaded instead of returning the value to be
66 // logged by the caller.