mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-26 06:22:26 +01:00
Only purge all domain data when explicitly asked rather than when history is specified.
This commit is contained in:
@@ -198,6 +198,7 @@
|
||||
<dt>downloads </dt> <dd>Download history</dd>
|
||||
<dt>formdata </dt> <dd>Saved form and search history</dd>
|
||||
<dt>history </dt> <dd>Browsing history</dd>
|
||||
<dt>host </dt> <dd>All data from the given host</dd>
|
||||
<dt>marks </dt> <dd>Local and URL marks</dd>
|
||||
<dt>macros </dt> <dd>Saved macros</dd>
|
||||
<dt>messages </dt> <dd>Saved <ex>:messages</ex></dd>
|
||||
@@ -225,27 +226,27 @@
|
||||
|
||||
<note>
|
||||
The following items are always cleared entirely, regardless of
|
||||
<a>timeframe</a>: <em>cache</em>, <em>offlineapps</em>,
|
||||
<a>timeframe</a>: <em>cache</em>, <em>host</em>, <em>offlineapps</em>,
|
||||
<em>passwords</em>, <em>sessions</em>, <em>sitesettings</em>.
|
||||
Conversely, <em>options</em> are never cleared unless a host is
|
||||
specified.
|
||||
Conversely, <em>host</em> and <em>options</em> are never cleared
|
||||
unless a host is specified.
|
||||
</note>
|
||||
|
||||
<p>
|
||||
If <a>host</a> (short name <em>-h</em>) is specified, only items
|
||||
containing a reference to that domain or a subdomain thereof are
|
||||
cleared. Moreover, if <em>commandline</em> or <em>history</em> is
|
||||
specified, the invocation of the <em>:sanitize</em> command is
|
||||
naturally cleared as well.
|
||||
cleared. Moreover, if either of <em>commandline</em> or
|
||||
<em>history</em> is specified, the invocation of the
|
||||
<em>:sanitize</em> command is naturally cleared as well.
|
||||
</p>
|
||||
|
||||
<note>
|
||||
This only applies to <em>commandline</em>, <em>cookies</em>,
|
||||
<em>history</em>, <em>marks</em>, <em>messages</em>,
|
||||
<em>options</em>, and <em>sitesettings</em>. All other
|
||||
domain-specific data is cleared only along with <em>history</em>,
|
||||
domain-specific data is cleared only along with <em>host</em>,
|
||||
when a request is made to &dactyl.host; to purge all data for
|
||||
<em>host</em>. Included in this purge are all matching history
|
||||
<a>host</a>. Included in this purge are all matching history
|
||||
entries, cookies, closed tabs, form data, and location bar
|
||||
entries.
|
||||
</note>
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user