From 9385fb64728da2465fc11207e96a307e47f67486 Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Fri, 11 Nov 2005 05:34:34 +0000 Subject: [PATCH] Fixing 315976. Also adding form history and cookies to privacy clearing --- minimo/chrome/content/minimo.js | 7 +++- .../chrome/content/preferences/preferences.js | 39 +++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/minimo/chrome/content/minimo.js b/minimo/chrome/content/minimo.js index d5d6bb1aff0f..f8b112956583 100755 --- a/minimo/chrome/content/minimo.js +++ b/minimo/chrome/content/minimo.js @@ -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); diff --git a/minimo/chrome/content/preferences/preferences.js b/minimo/chrome/content/preferences/preferences.js index 9032a7dc2124..900195b5e0b3 100644 --- a/minimo/chrome/content/preferences/preferences.js +++ b/minimo/chrome/content/preferences/preferences.js @@ -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"]