diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm
index e9b823b0..beb8d624 100644
--- a/common/modules/buffer.jsm
+++ b/common/modules/buffer.jsm
@@ -634,6 +634,9 @@ var Buffer = Module("Buffer", {
| persist.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
let window = this.topWindow;
+ if (!file.exists())
+ file.create(Ci.nsIFile.NORMAL_FILE_TYPE, octal(666));
+
let downloadListener = new window.DownloadListener(window,
services.Transfer(uri, File(file).URI, "",
null, null, null, persist));
diff --git a/common/modules/main.jsm b/common/modules/main.jsm
index 6d6ba181..1321ab5e 100644
--- a/common/modules/main.jsm
+++ b/common/modules/main.jsm
@@ -199,13 +199,6 @@ overlay.overlayWindow(Object.keys(config.overlays), function _overlay(window) ({
this.loaded = {};
modules.loaded = this.loaded;
- defineModule.modules.forEach(function defModule(mod) {
- let names = Set(Object.keys(mod.INIT));
- if ("init" in mod.INIT)
- Set.add(names, "init");
-
- keys(names).forEach(function (name) { self.deferInit(name, mod.INIT, mod); });
- });
this.modules = modules;
this.scanModules();
@@ -310,28 +303,38 @@ overlay.overlayWindow(Object.keys(config.overlays), function _overlay(window) ({
let className = mod.className || mod.constructor.className;
- init[className] = function callee() {
- function finish() {
- this.currentDependency = className;
- defineModule.time(className, name, INIT[name], mod,
- modules.dactyl, modules, window);
- }
- if (!callee.frobbed) {
- callee.frobbed = true;
- if (modules[name] instanceof Class)
- modules[name].withSavedValues(["currentDependency"], finish);
- else
- finish.call({});
- }
- };
+ if (!Set.has(init, className)) {
+ init[className] = function callee() {
+ function finish() {
+ this.currentDependency = className;
+ defineModule.time(className, name, INIT[name], mod,
+ modules.dactyl, modules, window);
+ }
+ if (!callee.frobbed) {
+ callee.frobbed = true;
+ if (modules[name] instanceof Class)
+ modules[name].withSavedValues(["currentDependency"], finish);
+ else
+ finish.call({});
+ }
+ };
- INIT[name].require = function (name) { init[name](); };
+ INIT[name].require = function (name) { init[name](); };
+ }
},
scanModules: function scanModules() {
let self = this;
let { Module, modules } = this.modules;
+ defineModule.modules.forEach(function defModule(mod) {
+ let names = Set(Object.keys(mod.INIT));
+ if ("init" in mod.INIT)
+ Set.add(names, "init");
+
+ keys(names).forEach(function (name) { self.deferInit(name, mod.INIT, mod); });
+ });
+
Module.list.forEach(function frobModule(mod) {
if (!mod.frobbed) {
modules.__defineGetter__(mod.className, function () {
diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm
index 155cf393..39150460 100644
--- a/common/modules/sanitizer.jsm
+++ b/common/modules/sanitizer.jsm
@@ -18,6 +18,7 @@ defineModule("sanitizer", {
});
lazyRequire("messages", ["_"]);
+lazyRequire("overlay", ["overlay"]);
lazyRequire("storage", ["storage"]);
lazyRequire("template", ["template"]);
@@ -179,60 +180,63 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
}
});
- let (branch = Item.PREFIX + Item.SHUTDOWN_BRANCH) {
- util.overlayWindow("chrome://browser/content/preferences/sanitize.xul",
- function (win) prefOverlay(branch, true, {
- append: {
- SanitizeDialogPane:
-
-
-
-
- {
- let (items = ourItems(true))
- template.map(util.range(0, Math.ceil(items.length / 2)), function (i)
- {
- template.map(items.slice(i * 2, i * 2 + 2), function (item)
- )
- }
)
- }
-
-
- }
- }));
- }
- let (branch = Item.PREFIX + Item.BRANCH) {
- util.overlayWindow("chrome://browser/content/sanitize.xul",
- function (win) prefOverlay(branch, false, {
- append: {
- itemList: <>
-
- {
- template.map(ourItems(), function ([item, desc])
- )
- }
- >
- },
- ready: function ready(win) {
- let elem = win.document.getElementById("itemList");
- elem.setAttribute("rows", elem.itemCount);
- win.Sanitizer = Class("Sanitizer", win.Sanitizer, {
- sanitize: function sanitize() {
- self.withSavedValues(["sanitizing"], function () {
- self.sanitizing = true;
- sanitize.superapply(this, arguments);
- sanitizer.sanitizeItems([item.name for (item in values(self.itemMap))
- if (item.shouldSanitize(false))],
- Range.fromArray(this.range || []));
- }, this);
- }
- });
- }
- }));
- }
+ util.timeout(function () { // Load order issue...
+
+ let (branch = Item.PREFIX + Item.SHUTDOWN_BRANCH) {
+ overlay.overlayWindow("chrome://browser/content/preferences/sanitize.xul",
+ function (win) prefOverlay(branch, true, {
+ append: {
+ SanitizeDialogPane:
+
+
+
+
+ {
+ let (items = ourItems(true))
+ template.map(util.range(0, Math.ceil(items.length / 2)), function (i)
+ {
+ template.map(items.slice(i * 2, i * 2 + 2), function (item)
+ )
+ }
)
+ }
+
+
+ }
+ }));
+ }
+ let (branch = Item.PREFIX + Item.BRANCH) {
+ overlay.overlayWindow("chrome://browser/content/sanitize.xul",
+ function (win) prefOverlay(branch, false, {
+ append: {
+ itemList: <>
+
+ {
+ template.map(ourItems(), function ([item, desc])
+ )
+ }
+ >
+ },
+ ready: function ready(win) {
+ let elem = win.document.getElementById("itemList");
+ elem.setAttribute("rows", elem.itemCount);
+ win.Sanitizer = Class("Sanitizer", win.Sanitizer, {
+ sanitize: function sanitize() {
+ self.withSavedValues(["sanitizing"], function () {
+ self.sanitizing = true;
+ sanitize.superapply(this, arguments);
+ sanitizer.sanitizeItems([item.name for (item in values(self.itemMap))
+ if (item.shouldSanitize(false))],
+ Range.fromArray(this.range || []));
+ }, this);
+ }
+ });
+ }
+ }));
+ }
+ });
},
firstRun: 0,