2 function load_rc_file(file)
6 if (typeof file == "string")
11 subscript_loader.loadSubScript("file://" + name, conkeror);
17 function load_rc_directory (file_o) {
18 var entries = file_o.directoryEntries;
20 while (entries.hasMoreElements ()) {
21 var entry = entries.getNext ();
22 entry.QueryInterface (Ci.nsIFile);
23 if (entry.leafName.match(/^[^.].*\.js$/i)) {
27 files.sort(function (a, b) {
28 if (a.leafName < b.leafName) {
30 } else if (a.leafName > b.leafName) {
36 for (var i = 0; i < files.length; i++) {
37 load_rc_file(files[i]);
43 * path_s: string path to load. may be a file, a directory, or null.
44 * if it is a file, that file will be loaded. if it is a directory,
45 * all `.js' files in that directory will be loaded. if it is null,
46 * the preference `conkeror.rcfile' will be read for the default.
48 function load_rc(path_s)
52 if (pref_has_user_value("conkeror.rcfile")) {
53 var rcfile = get_pref("conkeror.rcfile");
63 var file_o = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
64 file_o.initWithPath(path_s);
65 if (file_o.isDirectory()) {
66 load_rc_directory (file_o);
68 load_rc_file (path_s);
72 require_later("command-line.js");
74 call_after_load("command-line.js", function () {
75 command_line_param_handler("l", false, function (path) {
78 } catch (e) { dump_error(e); }