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

[or-cvs] r15394: Change JS state early in the toggle. May address some issues (torbutton/trunk/src/chrome/content)



Author: mikeperry
Date: 2008-06-21 20:27:34 -0400 (Sat, 21 Jun 2008)
New Revision: 15394

Modified:
   torbutton/trunk/src/chrome/content/torbutton.js
Log:

Change JS state early in the toggle. May address some issues
with sites not working right after torbutton is toggled.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-06-21 23:57:36 UTC (rev 15393)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-06-22 00:27:34 UTC (rev 15394)
@@ -570,7 +570,15 @@
         }
         m_tb_prefs.setBoolPref("extensions.torbutton.warned_ff3", true);
     }
+    
+    // Toggle JS state early, since content window JS runs in a different
+    // thread
+    torbutton_log(2, 'Toggling JS state');
 
+    torbutton_toggle_jsplugins(mode, 
+            changed && torprefs.getBoolPref("isolate_content"),
+            torprefs.getBoolPref("no_tor_plugins"));
+
     torbutton_log(2, 'Setting user agent');
     
     if(torprefs.getBoolPref("set_uagent")) {
@@ -621,7 +629,6 @@
                 if(m_tb_prefs.prefHasUserValue("general.platform.override"))
                     m_tb_prefs.clearUserPref("general.platform.override");
 
-                // XXX: Is this ok on ff2?
                 if(m_tb_prefs.prefHasUserValue("general.oscpu.override"))
                     m_tb_prefs.clearUserPref("general.oscpu.override");
                 if(m_tb_prefs.prefHasUserValue("general.buildID.override"))
@@ -729,11 +736,7 @@
         m_tb_prefs.setBoolPref("security.enable_java", !mode);
     }
 
-    torbutton_toggle_jsplugins(mode, 
-            changed && torprefs.getBoolPref("isolate_content"),
-            torprefs.getBoolPref("no_tor_plugins"));
 
-
     if (torprefs.getBoolPref('clear_cache')) {
         var cache = Components.classes["@mozilla.org/network/cache-service;1"].
         getService(Components.interfaces.nsICacheService);