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
11 let default_rc = get_home_directory();
12 default_rc.appendRelativePath(".conkerorrc");
13 default_pref("conkeror.rcfile", default_rc.path);
18 var rcfile = get_pref("conkeror.rcfile");
19 if (rcfile.length == 0) {
20 dumpln("w: preference conkeror.rcfile is unset");
23 path = make_file(rcfile);
25 if (! path.exists()) {
26 if (file_symlink_p(path)) {
27 dumpln("w: broken symlink, \""+rcfile+"\"");
28 } else if (pref_has_user_value("conkeror.rcfile")) {
29 dumpln("w: preference conkeror.rcfile is set to "+
30 "non-existent path, \""+rcfile+"\"");
32 dumpln("w: conkeror.rcfile \"" + rcfile +
40 if (path.isDirectory()) {
41 var entries = path.directoryEntries;
42 while (entries.hasMoreElements()) {
43 var entry = entries.getNext();
44 entry.QueryInterface(Ci.nsIFile);
45 if (entry.leafName.substr(-3).toLowerCase() == '.js') {
49 files.sort(function (a, b) {
50 if (a.leafName < b.leafName) {
52 } else if (a.leafName > b.leafName) {
58 path.appendRelativePath("a");
59 ret = path.path.substr(0, path.path.length - 1) + "*.js";
64 var obs = Cc["@mozilla.org/observer-service;1"]
65 .getService(Ci.nsIObserverService);
66 obs.notifyObservers(null, "startupcache-invalidate", null);
67 for (var file of files) {
70 dumpln("i: loaded rc file " + file.leafName)