Fixing 315976. Also adding form history and cookies to privacy clearing

This commit is contained in:
dougt%meer.net 2005-11-11 05:34:34 +00:00
parent ac3f79fa07
commit 9385fb6472
2 changed files with 38 additions and 8 deletions

View File

@ -705,8 +705,13 @@ function URLBarEntered()
{
try
{
if (!gURLBar)
return;
var url = gURLBar.value;
if (gURLBar.value == "" || gURLBar.value == null)
return;
var fixedUpURI = gURIFixup.createFixupURI(url, 2 /*fixup url*/ );
gGlobalHistory.markPageAsTyped(fixedUpURI);

View File

@ -47,17 +47,42 @@ function writeProxyPref()
function sanitizeAll()
{
// Cookies
try
{
var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager);
cookieMgr.removeAll()
} catch (e) { }
// Form Data
try
{
var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]
.getService(Components.interfaces.nsIFormHistory);
formHistory.removeAllEntries();
} catch (e) { }
// Cache
var classID = Components.classes["@mozilla.org/network/cache-service;1"];
var cacheService = classID.getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_IN_MEMORY);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ON_DISK);
try
{
var classID = Components.classes["@mozilla.org/network/cache-service;1"];
var cacheService = classID.getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_IN_MEMORY);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ON_DISK);
} catch (e) { }
// Autocomplete
var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
.getService(Components.interfaces.nsIBrowserHistory);
globalHistory.removeAllPages();
try
{
var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
.getService(Components.interfaces.nsIBrowserHistory);
globalHistory.removeAllPages();
} catch (e) { }
// Session History
try
{
var os = Components.classes["@mozilla.org/observer-service;1"]