1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 14:14:13 +01:00

Make info directory before attempting to save files there.

This commit is contained in:
Kris Maglione
2014-03-01 18:06:10 -08:00
parent fb976055c7
commit 9653c379e4
3 changed files with 16 additions and 11 deletions

View File

@@ -711,7 +711,10 @@ var Events = Module("events", {
return Events.kill(event);
}
if (!this.processor) {
if (this.processor)
events.dbg("ON KEYPRESS " + key + " processor: " + this.processor,
event.originalTarget instanceof Element ? event.originalTarget : String(event.originalTarget));
else {
let mode = modes.getStack(0);
if (event.dactylMode)
mode = Modes.StackElement(event.dactylMode);

View File

@@ -378,12 +378,12 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
UNPERMS: Class.Memoize(function () iter(this.PERMS).map(Array.reverse).toObject()),
COMMANDS: {
unset: /*L*/"Unset",
allow: /*L*/"Allowed",
deny: /*L*/"Denied",
session: /*L*/"Allowed for the current session",
list: /*L*/"List all cookies for domain",
clear: /*L*/"Clear all cookies for domain",
"unset": /*L*/"Unset",
"allow": /*L*/"Allowed",
"deny": /*L*/"Denied",
"session": /*L*/"Allowed for the current session",
"list": /*L*/"List all cookies for domain",
"clear": /*L*/"Clear all cookies for domain",
"clear-persistent": /*L*/"Clear all persistent cookies for domain",
"clear-session": /*L*/"Clear all session cookies for domain"
},

View File

@@ -6,7 +6,7 @@
defineModule("storage", {
exports: ["File", "Storage", "storage"],
require: ["services", "util"]
require: ["promises", "services", "util"]
});
lazyRequire("config", ["config"]);
@@ -227,16 +227,18 @@ var Storage = Module("Storage", {
}
},
_saveData: function saveData(obj) {
_saveData: promises.task(function saveData(obj) {
if (obj.privateData && storage.privateMode)
return;
if (obj.store && storage.infoPath) {
var { path } = storage.infoPath.child(obj.name);
return OS.File.writeAtomic(
yield OS.File.makeDir(storage.infoPath.path,
{ ignoreExisting: true });
yield OS.File.writeAtomic(
path, obj.serial,
{ tmpPath: path + ".part" });
}
},
}),
storeForSession: function storeForSession(key, val) {
if (val)