init.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // "~/.conkerorrc" should be a symlink to this file ("init.js"). Other
  2. // js-files loaded with `al_load_rc` are placed in the same directory
  3. // (with this file).
  4. // Documentation for working with files:
  5. // <https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile>
  6. require("duckduckgo");
  7. require("page-modes/wikipedia.js");
  8. require("dom-inspector");
  9. require("favicon");
  10. require("new-tabs.js");
  11. require("clicks-in-new-buffer.js");
  12. var current_profile = get_current_profile();
  13. var al_load_dir;
  14. function al_load (relpath) {
  15. var file = al_load_dir.clone();
  16. file.appendRelativePath(relpath);
  17. if (file.exists())
  18. load(file);
  19. else
  20. dumpln("WARNING: file '" + file.path + "' does not exist");
  21. }
  22. function al_load_rc () {
  23. var rcfile = make_file((get_pref("conkeror.rcfile")));
  24. al_load_dir = make_file(rcfile.target).parent;
  25. al_load("other/modules/player-mode/player.js");
  26. al_load("keys.js");
  27. al_load("settings.js");
  28. al_load("text.js");
  29. al_load("visual.js");
  30. al_load("other/rc/thorkill/dot.conkerorrc/100-login.js");
  31. }
  32. al_load_rc();
  33. interactive("test", null,
  34. function (I) {
  35. I.window.minibuffer.show("conkerorrc was loaded successfully!");
  36. });