[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10712: Differentiate between "crucial" and "recommended" settings i (in torbutton/trunk/src: . chrome/content chrome/locale/en-US defaults/preferences)



Author: mikeperry
Date: 2007-06-30 16:19:22 -0400 (Sat, 30 Jun 2007)
New Revision: 10712

Modified:
   torbutton/trunk/src/chrome/content/jshooks.js
   torbutton/trunk/src/chrome/content/preferences.js
   torbutton/trunk/src/chrome/content/preferences.xul
   torbutton/trunk/src/chrome/content/torbutton.js
   torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
   torbutton/trunk/src/defaults/preferences/preferences.js
   torbutton/trunk/src/install.rdf
Log:

Differentiate between "crucial" and "recommended" settings in
dtd strings. Add "Disable session saving" pref to disable
session store, which can do surprising things if the browser
crashes while you had Tor off (all your tor tabs would be
reloaded without Tor). Not sure if that makes it a
recommended or crucial setting.



Modified: torbutton/trunk/src/chrome/content/jshooks.js
===================================================================
--- torbutton/trunk/src/chrome/content/jshooks.js	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/chrome/content/jshooks.js	2007-06-30 20:19:22 UTC (rev 10712)
@@ -137,11 +137,15 @@
     Date.prototype.toLocaleDateString=function(){return d.toUTCString();}
     Date.prototype.toDateString=function(){return d.toUTCString();}
     Date.prototype.toTimeString=function(){return d.toUTCString();}
-
+    
     /* Hack to solve the problem of multiple date objects
      * all sharing the same lexically scoped d every time a new one is
      * created. This hack creates a fresh new prototype reference for 
      * the next object to use with a different d binding.
+     * It doesn't break stuff because at the start of this function, 
+     * the interpreter grabbed a reference to Date.prototype. During 
+     * this function we modified Date.prototype to create the new methods
+     * with the lexically scoped d reference.
      */
     Date.prototype = new Object.prototype.toSource();
     return d.toUTCString();

Modified: torbutton/trunk/src/chrome/content/preferences.js
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.js	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/chrome/content/preferences.js	2007-06-30 20:19:22 UTC (rev 10712)
@@ -172,6 +172,7 @@
             = doc.getElementById('torbutton_allShutdown');
     }
 
+    doc.getElementById('torbutton_noSessionStore').checked = o_torprefs.getBoolPref('disable_sessionstore');
     doc.getElementById('torbutton_blockTorHRead').checked = o_torprefs.getBoolPref('block_thread');
     doc.getElementById('torbutton_blockTorHWrite').checked = o_torprefs.getBoolPref('block_thwrite');
     doc.getElementById('torbutton_blockNonTorHRead').checked = o_torprefs.getBoolPref('block_nthread');
@@ -240,6 +241,7 @@
         o_torprefs.setIntPref('shutdown_method', 2); 
     }
 
+    o_torprefs.setBoolPref('disable_sessionstore', doc.getElementById('torbutton_noSessionStore').checked);
     o_torprefs.setBoolPref('block_thread', doc.getElementById('torbutton_blockTorHRead').checked);
     o_torprefs.setBoolPref('block_thwrite', doc.getElementById('torbutton_blockTorHWrite').checked);
     o_torprefs.setBoolPref('block_nthread', doc.getElementById('torbutton_blockNonTorHRead').checked);

Modified: torbutton/trunk/src/chrome/content/preferences.xul
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.xul	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/chrome/content/preferences.xul	2007-06-30 20:19:22 UTC (rev 10712)
@@ -190,6 +190,8 @@
                    label="&torbutton.prefs.all_shutdown;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
             </radiogroup>
+            <checkbox id="torbutton_noSessionStore" label="&torbutton.prefs.disable_sessionstore;" 
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
            </vbox>
           </tabpanel>
           <tabpanel id="uagent">

Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2007-06-30 20:19:22 UTC (rev 10712)
@@ -1,4 +1,8 @@
 // TODO: check for leaks: http://www.mozilla.org/scriptable/avoiding-leaks.html
+// TODO: Double-check there are no strange exploits to defeat:
+//       http://kb.mozillazine.org/Links_to_local_pages_don%27t_work
+// FIXME: Browser accept, locale, currency? (intl.*)
+//    - Need to see which of these actually change and are server-visible
 
 // status
 var m_tb_wasinited = false;
@@ -69,6 +73,7 @@
             case "extensions.torbutton.block_nthwrite":
             case "extensions.torbutton.block_thwrite":
             case "extensions.torbutton.shutdown_method":
+            case "extensions.torbutton.disable_sessionstore":
                 torbutton_update_status(
                         m_tb_prefs.getBoolPref("extensions.torbutton.tor_enabled"),
                         true);
@@ -518,11 +523,18 @@
         torbutton_clear_history();
     }
 
+    // FIXME:
+    // http://lxr.mozilla.org/seamonkey/source/browser/components/sessionstore/nsISessionStore.idl
+    // or just make a pref to always disable store
+    // http://wiki.mozilla.org/Session_Restore
     // http://kb.mozillazine.org/Browser.sessionstore.privacy_level
     // http://kb.mozillazine.org/About:config_entries
+
+    m_tb_prefs.setBoolPref("browser.sessionstore.enabled", 
+            !torprefs.getBoolPref("disable_sessionstore"));
+
     if(mode) {
         if(torprefs.getBoolPref('block_thwrite')) {
-            m_tb_prefs.setIntPref("browser.sessionstore.enabled", false);
             m_tb_prefs.setIntPref("browser.download.manager.retention", 0);
             m_tb_prefs.setBoolPref("browser.formfill.enable", false);
             m_tb_prefs.setBoolPref("signon.rememberSignons", false);
@@ -534,12 +546,10 @@
         }
     } else {
         if(torprefs.getBoolPref('block_nthwrite')) {
-            m_tb_prefs.setIntPref("browser.sessionstore.enabled", false);
             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.enabled", true);
             m_tb_prefs.setIntPref("browser.download.manager.retention", 2);
             m_tb_prefs.setBoolPref("browser.formfill.enable", true);
             m_tb_prefs.setBoolPref("signon.rememberSignons", true);

Modified: torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2007-06-30 20:19:22 UTC (rev 10712)
@@ -15,9 +15,9 @@
 <!ENTITY torbutton.prefs.proxy.host.socks               "SOCKS Host:">
 <!ENTITY torbutton.prefs.proxy.port                     "Port:">
 <!ENTITY torbutton.prefs.sec_settings        "Security Settings">
-<!ENTITY torbutton.prefs.block_thread        "Block history reads during Tor (recomended)">
-<!ENTITY torbutton.prefs.block_thwrite       "Block history writes during Tor (recomended)">
-<!ENTITY torbutton.prefs.block_nthread       "Block history reads during Non-Tor (optional)">
+<!ENTITY torbutton.prefs.block_thread        "Block history reads during Tor (crucial)">
+<!ENTITY torbutton.prefs.block_thwrite       "Block history writes during Tor (recommended)">
+<!ENTITY torbutton.prefs.block_nthread       "Block history reads during Non-Tor (recommended)">
 <!ENTITY torbutton.prefs.block_nthwrite      "Block history writes during Non-Tor (optional)">
 <!ENTITY torbutton.prefs.clear_history       "Clear history on Tor toggle (optional)">
 <!ENTITY torbutton.prefs.clear_cache        "Block Tor disk cache and clear all cache on Tor toggle">
@@ -25,11 +25,11 @@
 <!ENTITY torbutton.prefs.cookie_jars        "Store Non-Tor cookies in a protected jar">
 <!ENTITY torbutton.prefs.mmm_cookies        "I will manually manage my cookies (dangerous)">
 <!ENTITY torbutton.prefs.clear_cookies      "Clear cookies on Tor toggle">
-<!ENTITY torbutton.prefs.disable_plugins    "Disable plugins during Tor usage (recommended)">
-<!ENTITY torbutton.prefs.kill_bad_js        "Block dangerous javascript (recommended)">
-<!ENTITY torbutton.prefs.isolate_content    "Isolate dynamic content to Tor state (recommended)">
+<!ENTITY torbutton.prefs.disable_plugins    "Disable plugins during Tor usage (crucial)">
+<!ENTITY torbutton.prefs.kill_bad_js        "Block dangerous javascript (crucial)">
+<!ENTITY torbutton.prefs.isolate_content    "Isolate dynamic content to Tor state (crucial)">
 <!ENTITY torbutton.prefs.no_updates         "Disable updates during Tor usage (recommended)">
-<!ENTITY torbutton.prefs.set_uagent         "Set user agent for Tor usage (recommended)">
+<!ENTITY torbutton.prefs.set_uagent         "Set user agent for Tor usage (crucial)">
 <!ENTITY torbutton.prefs.dynamic              "Dynamic Content">
 <!ENTITY torbutton.prefs.cookies              "Cookies">
 <!ENTITY torbutton.prefs.cache                "Cache">
@@ -40,6 +40,7 @@
 <!ENTITY torbutton.prefs.tor_shutdown          "Clear cookies during Tor-enabled browser shutdown">
 <!ENTITY torbutton.prefs.all_shutdown          "Clear cookies during any browser shutdown">
 <!ENTITY torbutton.prefs.no_shutdown           "Let me manage my own Private Data settings">
+<!ENTITY torbutton.prefs.disable_sessionstore  "Disable Session Saving (recommended)">
 <!ENTITY torbutton.about.title                          "About Torbutton">
 <!ENTITY torbutton.pref_connection.notice               "Disable Torbutton to change these settings.">
 <!ENTITY torbutton.pref_connection.more_info            "More information">

Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/defaults/preferences/preferences.js	2007-06-30 20:19:22 UTC (rev 10712)
@@ -55,6 +55,7 @@
 pref("extensions.torbutton.isolate_content",true);
 pref("extensions.torbutton.no_search",true);
 pref("extensions.torbutton.set_uagent",true);
+pref("extensions.torbutton.disable_sessionstore",true);
 pref("extensions.torbutton.shutdown_method",1); // 0=none, 1=tor, 2=all
 
 // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Modified: torbutton/trunk/src/install.rdf
===================================================================
--- torbutton/trunk/src/install.rdf	2007-06-30 19:18:28 UTC (rev 10711)
+++ torbutton/trunk/src/install.rdf	2007-06-30 20:19:22 UTC (rev 10712)
@@ -6,7 +6,7 @@
         <em:name>Torbutton</em:name>
         <em:creator>Scott Squires &amp; Mike Perry</em:creator>
         <em:id>{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}</em:id>
-        <em:version>1.1.2-alpha</em:version>
+        <em:version>1.1.3-alpha</em:version>
         <em:homepageURL>http://freehaven.net/~squires/torbutton/</em:homepageURL>
         <em:updateURL>http://freehaven.net/~squires/torbutton/update.rdf</em:updateURL>
         <em:optionsURL>chrome://torbutton/content/preferences.xul</em:optionsURL>