add: if (torprefs.getBoolPref('clear_history')) { torbutton_clear_history(); }    if(mode) { if(torprefs.getBoolPref('block_thwrite')) { m_tb_prefs.setIntPref("browser.sessionstore.privacy_level", 2); m_tb_prefs.setIntPref("browser.download.manager.retention", 0); m_tb_prefs.setBoolPref("browser.formfill.enable", false); m_tb_prefs.setBoolPref("signon.rememberSignons", false); } else { m_tb_prefs.setIntPref("browser.sessionstore.privacy_level", 1); m_tb_prefs.setIntPref("browser.download.manager.retention", 2); m_tb_prefs.setBoolPref("browser.formfill.enable", true); m_tb_prefs.setBoolPref("signon.rememberSignons", true); } } else { if(torprefs.getBoolPref('block_nthwrite')) { m_tb_prefs.setIntPref("browser.sessionstore.privacy_level", 2); m_tb_prefs.setIntPref("browser.download.manager.retention", 0); m_tb_prefs.setBoolPref("browser.formfill.enable", false); m_tb_prefs.setBoolPref("signon.rememberSignons", false); } else { m_tb_prefs.setIntPref("browser.sessionstore.privacy_level", 1); m_tb_prefs.setIntPref("browser.download.manager.retention", 2); m_tb_prefs.setBoolPref("browser.formfill.enable", true); m_tb_prefs.setBoolPref("signon.rememberSignons", true); } }  torbutton_log(1, "Prefs pretty much done");   if(!changed && force_update) return;  if (torprefs.getBoolPref('clear_cookies')) { torbutton_clear_cookies(); } else if (torprefs.getBoolPref('cookie_jars')) { torbutton_jar_cookies(mode); }  
context: function torbutton_update_status(mode) {    var o_toolbutton = false;    var o_statuspanel = false;    var o_stringbundle = false;    var sPrefix;    var label;    var tooltip;        var torprefs = torbutton_get_prefbranch('extensions.torbutton.');    var changed = (torprefs.getBoolPref('tor_enabled') != mode);    torprefs.setBoolPref('tor_enabled', mode);    torbutton_log(2, 'called update_status: '+mode);    torbutton_update_toolbutton(mode);    torbutton_update_statusbar(mode);    torbutton_log(2, 'Setting user agent');    if(torprefs.getBoolPref("set_uagent")) {        if(mode) {            m_prefs.setCharPref("general.appname.override",                 torprefs.getCharPref("appname_override"));            m_prefs.setCharPref("general.appversion.override",                torprefs.getCharPref("appversion_override"));            m_prefs.setCharPref("general.platform.override",                torprefs.getCharPref("platform_override"));            m_prefs.setCharPref("general.useragent.override",                torprefs.getCharPref("useragent_override"));            m_prefs.setCharPref("general.useragent.vendor",                torprefs.getCharPref("useragent_vendor"));            m_prefs.setCharPref("general.useragent.vendorSub",                torprefs.getCharPref("useragent_vendorSub"));        } else {            try {                m_prefs.clearUserPref("general.appname.override");                m_prefs.clearUserPref("general.appversion.override");                m_prefs.clearUserPref("general.platform.override");                m_prefs.clearUserPref("general.useragent.override");                m_prefs.clearUserPref("general.useragent.vendor");                m_prefs.clearUserPref("general.useragent.vendorSub");            } catch (e) {                // This happens because we run this from time to time                torbutton_log(1, "Prefs already cleared");            }        }    }        torbutton_log(2, 'Done with user agent: '+changed);    // this function is called every time there is a new window! Alot of this    // stuff expects to be called on toggle only.. like the cookie jars and    // history/cookie clearing    if(!changed) return;    // XXX: store user settings for these groups     //      - never enable them if user wants them off.    if (torprefs.getBoolPref("no_updates")) {        m_prefs.setBoolPref("extensions.update.enabled", !mode);        m_prefs.setBoolPref("app.update.enabled", !mode);        m_prefs.setBoolPref("app.update.auto", !mode);        m_prefs.setBoolPref("browser.search.update", !mode);    }    if (torprefs.getBoolPref('block_cache')) {        m_prefs.setBoolPref("browser.cache.memory.enable", !mode);        m_prefs.setBoolPref("network.http.use-cache", !mode);    }    // Always block disk cache during Tor. We clear it on toggle,     // so no need to keep it around for someone to rifle through.    m_prefs.setBoolPref("browser.cache.disk.enable", !mode);    // Always, always disable remote "safe browsing" lookups.    m_prefs.setBoolPref("browser.safebrowsing.remoteLookups", false);    if (torprefs.getBoolPref("no_search")) {        m_prefs.setBoolPref("browser.search.suggest.enabled", !mode);    }            if(torprefs.getBoolPref("no_tor_plugins")) {        m_prefs.setBoolPref("security.enable_java", !mode);    }    torbutton_toggle_jsplugins(!mode,             torprefs.getBoolPref("isolate_content"),            torprefs.getBoolPref("no_tor_plugins"));    // TODO: Investigate Firefox privacy clear-data settings..     // Form data, download history, passwords?    // Can these items be excluded from being recorded during tor usage?    if (torprefs.getBoolPref('clear_history')) {        ClearHistory();    }    if (torprefs.getBoolPref('clear_cookies')) {        ClearCookies();    } else if (torprefs.getBoolPref('jar_cookies')) {        JarCookies(mode);    }    if (torprefs.getBoolPref('clear_cache')) {        var cache = Components.classes["@mozilla.org/network/cache-service;1"].        getService(Components.interfaces.nsICacheService);        cache.evictEntries(0);    }}
meta: 3444	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3444/6d16d2398792e6b4fdd065aeb02351a0b494ec98/torbutton.js/buggy/src/chrome/content/torbutton.js