aboutsummaryrefslogtreecommitdiffstats
path: root/clear_privacy_data.js
diff options
context:
space:
mode:
authorteramako2009-01-06 13:45:02 +0000
committerteramako2009-01-06 13:45:02 +0000
commit10e27228854511c62b9af83e6ada807ada78875c (patch)
treef379147e19ac19f082443c83add95ec7aa814b46 /clear_privacy_data.js
parent4aba0c2c24edeafb874460da794a1758e0ae088d (diff)
downloadvimperator-plugins-10e27228854511c62b9af83e6ada807ada78875c.tar.bz2
add feature of download history
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28030 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'clear_privacy_data.js')
-rw-r--r--clear_privacy_data.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/clear_privacy_data.js b/clear_privacy_data.js
index d0dba59..b122df9 100644
--- a/clear_privacy_data.js
+++ b/clear_privacy_data.js
@@ -51,7 +51,7 @@ var PLUGIN_INFO =
</VimperatorPlugin>;
liberator.plugins.privacySanitizer = (function(){
-if (Application.version.substring(0, 3) != "3.1") return null;
+//if (Application.version.substring(0, 3) != "3.1") return null;
var privacyManager = { // {{{
cache: {
@@ -129,6 +129,31 @@ var privacyManager = { // {{{
},
getPref: function() options.getPref("privacy.cpd.formdata")
},
+ downloads: {
+ clear: function(range){
+ var dlMgr = Cc["@mozilla.org/download-manager;1"].getService(Ci.nsIDownloadManager);
+ let dlIDsRemove = [];
+ if (range){
+ dlMgr.removeDownloadsByTimeframe(range[0], range[1]);
+ let dlsEnum = dlMgr.activeDownloads;
+ while (dlsEnum.hasMoreElements()){
+ let dl = dlsEnum.next();
+ if (dl.startTime >= range[0])
+ dlIDsRemove.push(dl.id);
+ }
+ } else {
+ dlMgr.cleanUp();
+ let dlsEnum = dlMgr.activeDownloads;
+ while (dlsEnum.hasMoreElements()){
+ dlIDsRemove.push(dlsEnum.next().id)
+ }
+ }
+ dlIDsRemove.forEach(function(id) {
+ dlMgr.removeDownload(id);
+ });
+ },
+ getPref: function() options.getPref("privacy.cpd.downloads")
+ },
sessions: {
clear: function(){
var sdr = Cc["@mozilla.org/security/sdr;1"].getService(Ci.nsISecretDecoderRing);