mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 21:45: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)
|
if (options.getPref(self.prefDomain2 + "commandLine") == null)
|
||||||
options.setPref(self.prefDomain2 + "commandLine", false)
|
options.setPref(self.prefDomain2 + "commandLine", false)
|
||||||
|
|
||||||
|
self.getClearRange = Sanitizer.getClearRange;
|
||||||
|
|
||||||
// Largely ripped from from browser/base/content/sanitize.js so we can override
|
// Largely ripped from from browser/base/content/sanitize.js so we can override
|
||||||
// the pref strategy without stepping on the global prefs namespace.
|
// the pref strategy without stepping on the global prefs namespace.
|
||||||
self.sanitize = function () {
|
self.sanitize = function () {
|
||||||
|
|||||||
@@ -167,10 +167,16 @@ function CommandLine() //{{{
|
|||||||
/**
|
/**
|
||||||
* Removes any private data from this history.
|
* Removes any private data from this history.
|
||||||
*/
|
*/
|
||||||
sanitize: function ()
|
sanitize: function (timespan)
|
||||||
{
|
{
|
||||||
// TODO: Respect privacy.item.timeSpan (options["sts"])
|
let range = [0, Number.MAX_VALUE];
|
||||||
this.store.mutate("filter", function (line) !line.privateData);
|
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.
|
* Replace the current input field value.
|
||||||
|
|||||||
Reference in New Issue
Block a user