diff --git a/common/locale/en-US/various.xml b/common/locale/en-US/various.xml index c66f85d6..da02cd66 100644 --- a/common/locale/en-US/various.xml +++ b/common/locale/en-US/various.xml @@ -198,6 +198,7 @@
downloads
Download history
formdata
Saved form and search history
history
Browsing history
+
host
All data from the given host
marks
Local and URL marks
macros
Saved macros
messages
Saved :messages
@@ -225,27 +226,27 @@ The following items are always cleared entirely, regardless of - timeframe: cache, offlineapps, + timeframe: cache, host, offlineapps, passwords, sessions, sitesettings. - Conversely, options are never cleared unless a host is - specified. + Conversely, host and options are never cleared + unless a host is specified.

If host (short name -h) is specified, only items containing a reference to that domain or a subdomain thereof are - cleared. Moreover, if commandline or history is - specified, the invocation of the :sanitize command is - naturally cleared as well. + cleared. Moreover, if either of commandline or + history is specified, the invocation of the + :sanitize command is naturally cleared as well.

This only applies to commandline, cookies, history, marks, messages, options, and sitesettings. All other - domain-specific data is cleared only along with history, + domain-specific data is cleared only along with host, when a request is made to &dactyl.host; to purge all data for - host. Included in this purge are all matching history + host. Included in this purge are all matching history entries, cookies, closed tabs, form data, and location bar entries. diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 33242e9b..bc52366c 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -113,7 +113,7 @@ var ConfigBase = Class("ConfigBase", { io.pathSearch("hg")) { return io.system(["hg", "-R", uri.file.parent.path, "log", "-r.", - "--template=hg{rev} ({date|isodate})"]); + "--template=hg{rev} ({date|isodate})"]).output; } } let version = this.addon.version; diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 58d2fb6b..0aaa3c9e 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -436,7 +436,7 @@ var IO = Module("io", { * * @param {string} command The command to run. * @param {string} input Any input to be provided to the command on stdin. - * @returns {string} + * @returns {object} */ system: function (command, input) { util.dactyl.echomsg("Calling shell to execute: " + command, 4); @@ -472,7 +472,8 @@ var IO = Module("io", { __noSuchMethod__: function (meth, args) this.output[meth].apply(this.output, args), valueOf: function () this.output, output: stdout.read().replace(/^(.*)\n$/, "$1"), - returnValue: res + returnValue: res, + toString: function () this.output }; }) || ""; }, diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index b4cd74f6..47f402e8 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -78,7 +78,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef this.addItem("cache", { builtin: true, description: "Cache" }); this.addItem("downloads", { builtin: true, description: "Download history" }); this.addItem("formdata", { builtin: true, description: "Saved form and search history" }); - this.addItem("history", { builtin: true, description: "Browsing history", sessionHistory: true }); this.addItem("offlineapps", { builtin: true, description: "Offline website data" }); this.addItem("passwords", { builtin: true, description: "Saved passwords" }); this.addItem("sessions", { builtin: true, description: "Authenticated sessions" }); @@ -96,6 +95,32 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef }, override: true }); + this.addItem("history", { + builtin: true, + description: "Browsing history", + persistent: true, + sessionHistory: true, + action: function (range, host) { + if (host) + services.history.removePagesFromHost(host, true); + else + services.history.removeVisitsByTimeframe(this.range.min, this.range.max); + + if (!host) + services.observer.notifyObservers(null, "browser:purge-session-history", ""); + + if (!host || util.isDomainURL(prefs.get("general.open_location.last_url"), host)) + prefs.reset("general.open_location.last_url"); + }, + override: true + }); + this.addItem("host", { + description: "All data from the given host", + action: function (range, host) { + if (host) + services.privateBrowsing.removeDataFromDomain(host); + } + }); this.addItem("sitesettings", { builtin: true, description: "Site preferences", @@ -398,8 +423,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef if (args["-host"]) { args["-host"].forEach(function (host) { sanitizer.sanitizing = true; - if (items.indexOf("history") > -1) - services.privateBrowsing.removeDataFromDomain(host); sanitizer.sanitizeItems(items, range, host) }); }