mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 02:15:46 +01:00
Respect 'sanitizetimespan' in command history sanitization.
This commit is contained in:
@@ -235,6 +235,8 @@ function Sanitizer() //{{{
|
||||
if (options.getPref(self.prefDomain2 + "commandLine") == null)
|
||||
options.setPref(self.prefDomain2 + "commandLine", false)
|
||||
|
||||
self.getClearRange = Sanitizer.getClearRange;
|
||||
|
||||
// Largely ripped from from browser/base/content/sanitize.js so we can override
|
||||
// the pref strategy without stepping on the global prefs namespace.
|
||||
self.sanitize = function () {
|
||||
|
||||
@@ -167,10 +167,16 @@ function CommandLine() //{{{
|
||||
/**
|
||||
* Removes any private data from this history.
|
||||
*/
|
||||
sanitize: function ()
|
||||
sanitize: function (timespan)
|
||||
{
|
||||
// TODO: Respect privacy.item.timeSpan (options["sts"])
|
||||
this.store.mutate("filter", function (line) !line.privateData);
|
||||
let range = [0, Number.MAX_VALUE];
|
||||
if (liberator.has("sanitizer") && (timespan || options["sanitizetimespan"]))
|
||||
range = sanitizer.getClearRange(timespan || options["sanitizetimespan"]);
|
||||
|
||||
this.store.mutate("filter", function (item) {
|
||||
let timestamp = (item.timestamp || Date.now()/1000) * 1000;
|
||||
return !line.privateData || timestamp < self.range[0] || timestamp > self.range[1];
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Replace the current input field value.
|
||||
|
||||
Reference in New Issue
Block a user