tor-browser-cfg-tail.js 588 B

12345678910111213141516
  1. // OpenBSD: Initialize ~/.tor-browser/torrc to an empty config.
  2. // The first SAVECONF to the tor control socket will overwrite it.
  3. var Cc = Components.classes;
  4. var Ci = Components.interfaces;
  5. var file = Cc["@mozilla.org/file/directory_service;1"].
  6. getService(Ci.nsIProperties).get("DefProfRt", Ci.nsIFile);
  7. file.append("torrc");
  8. if (!file.exists()) {
  9. var stream = Cc["@mozilla.org/network/file-output-stream;1"].
  10. createInstance(Ci.nsIFileOutputStream);
  11. stream.init(file, 0x04 | 0x08 | 0x20, 0600, 0);
  12. stream.write("#\n", 2);
  13. stream.close();
  14. }