[or-cvs] r11547: Fix for quickjava interaction issue spotted by phobos. (torbutton/trunk/src/chrome/content)

mikeperry at seul.org mikeperry at seul.org
Fri Sep 21 00:29:10 UTC 2007


Author: mikeperry
Date: 2007-09-20 20:29:10 -0400 (Thu, 20 Sep 2007)
New Revision: 11547

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

Fix for quickjava interaction issue spotted by phobos.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2007-09-20 23:02:13 UTC (rev 11546)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2007-09-21 00:29:10 UTC (rev 11547)
@@ -965,7 +965,7 @@
         /* XXX: Remove this once bug #460 is resolved */
         /* hrmm.. would doc.isSupported("javascript") 
          * or doc.implementation.hasFeature() work better? */
-        if(js_enabled && !tor_tag && doc.contentType.indexOf("text/html") != -1 && 
+        if(!tor_tag && doc.contentType.indexOf("text/html") != -1 && 
                 torbutton_check_load_state(doc, tor_tag) && 
                 !torbutton_check_flag(win.window.wrappedJSObject, 
                     "__tb_hooks_ran")) {
@@ -981,7 +981,7 @@
         /* XXX: Remove this once bug #460 is resolved */
         torbutton_log(2, "Check hook: "
                 + torbutton_check_flag(win, "__tb_did_hook"));
-        if(js_enabled && !tor_tag && doc.contentType.indexOf("text/html") != -1 && 
+        if(!tor_tag && doc.contentType.indexOf("text/html") != -1 && 
                 torbutton_check_load_state(doc, tor_tag) && 
                 !torbutton_check_flag(win.window.wrappedJSObject, "__tb_hooks_ran")) {
             torbutton_log(5, "FALSE DOC HOOKING. Please report bug+website!");
@@ -1008,7 +1008,10 @@
 
     torbutton_log(1, "JS set to: " + js_enabled);
     
-    // No need to hook js if tor is off, right?
+    if(!js_enabled) // XXX: bug #460 hack
+        win.window.wrappedJSObject.__tb_hooks_ran = true; 
+
+    // No need to hook js if tor is off
     if(!js_enabled 
             || !m_tb_prefs.getBoolPref("extensions.torbutton.tor_enabled") 
             || !m_tb_prefs.getBoolPref('extensions.torbutton.kill_bad_js')) {



More information about the tor-commits mailing list