diff --git a/common/content/editor.js b/common/content/editor.js index 007679db..c8758f61 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -861,7 +861,14 @@ var Editor = Module("editor", { "string", config.locale, { initValue: function () {}, - getter: function getter() services.spell.dictionary || "", + getter: function getter() { + try { + return services.spell.dictionary || ""; + } + catch (e) { + return ""; + } + }, setter: function setter(val) { services.spell.dictionary = val; }, completer: function completer(context) { let res = {}; diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index fa66f6fb..7a37f164 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1321,7 +1321,10 @@

The default list of private items to sanitize. See - :sanitize for a list and explanation of possible values. + :sanitize for a list and explanation of possible values. A + value of all will cause all items to be sanitized. Items + may be excluded by prefixing them with a !. The first + matching item takes precedence.

diff --git a/common/locale/en-US/privacy.xml b/common/locale/en-US/privacy.xml index 7782ff99..5ab2a402 100644 --- a/common/locale/en-US/privacy.xml +++ b/common/locale/en-US/privacy.xml @@ -75,6 +75,13 @@
sitesettings
Site preferences
+

+ Items may be excluded by prefixing them with a !. The first + matching item takes precedence. Therefore, the value + !commandline all will sanitize all items but the command + line. A value of all !commandline will sanitize all items. +

+

When history items are sanitized, all command-line history items containing URLs or page titles (other than bookmark diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 92753ed1..47c8c458 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -407,7 +407,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef function (args) { dactyl.assert(!modules.options['private'], _("command.sanitize.privateMode")); - if (args["-host"] && !args.length) + if (args["-host"] && !args.length && !args.bang) args[0] = "all"; let timespan = args["-timespan"] || modules.options["sanitizetimespan"]; @@ -418,15 +418,15 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef match ? 1000 * (Date.now() - 1000 * parseInt(num, 10) * { m: 60, h: 3600, d: 3600 * 24, w: 3600 * 24 * 7 }[unit]) : (timespan[0] == "s" ? sanitizer.sessionStart : null); - let items = args.slice(); - - if (args.bang) { + let opt = modules.options.get("sanitizeitems"); + if (args.bang) dactyl.assert(args.length == 0, _("error.trailingCharacters")); - items = Object.keys(sanitizer.itemMap).filter( - function (k) modules.options.get("sanitizeitems").has(k)); + else { + dactyl.assert(opt.validator(args), _("error.invalidArgument")); + opt = { __proto__: opt, value: args.slice() }; } - else - dactyl.assert(modules.options.get("sanitizeitems").validator(items), _("error.invalidArgument")); + + let items = Object.keys(sanitizer.itemMap).slice(1).filter(opt.has, opt); function sanitize(items) { sanitizer.range = range.native; @@ -442,13 +442,12 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef sanitizer.sanitize(items, range); } - if (items.indexOf("all") >= 0 && !args["-host"]) + if (array.nth(opt.value, function (i) i == "all" || /^!/.test(i), 0) == "all" && !args["-host"]) modules.commandline.input(_("sanitize.prompt.deleteAll") + " ", function (resp) { if (resp.match(/^y(es)?$/i)) { - items = Object.keys(sanitizer.itemMap).filter(function (k) items.indexOf(k) === -1); sanitize(items); - dactyl.echo(_("command.sanitize.allDeleted")); + dactyl.echomsg(_("command.sanitize.allDeleted")); } else dactyl.echo(_("command.sanitize.noneDeleted")); @@ -594,9 +593,19 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef "stringlist", "all", { get values() values(sanitizer.itemMap).toArray(), - has: modules.Option.has.toggleAll, + + completer: function completer(context, extra) { + if (context.filter[0] == "!") + context.advance(1); + return completer.superapply(this, arguments); + }, + + has: function has(val) + let (res = array.nth(this.value, function (v) v == "all" || v.replace(/^!/, "") == val, 0)) + res && !/^!/.test(res), + validator: function (values) values.length && - values.every(function (val) val === "all" || Set.has(sanitizer.itemMap, val)) + values.every(function (val) val === "all" || Set.has(sanitizer.itemMap, val.replace(/^!/, ""))) }); options.add(["sanitizeshutdown", "ss"], diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 2f3eeb25..7c32c645 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -174,6 +174,7 @@ variable. [b4] - 'passkeys' is now a [sitemap] with key chain support rather than a [regexpmap]. [b6] + - The precise format of 'sanitizeitems' has changed slightly. [b8] - 'showmode' is now a [regexplist]. [b6] - 'showstatuslinks' and 'showtabline' are now [string] options. [b4] • IMPORTANT: Command script files now use the *.penta file extension. [b2]