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

[or-cvs] r13344: Fix up content policy to not break form submits and favicons (in torbutton/trunk/src: components defaults/preferences)



Author: mikeperry
Date: 2008-01-30 23:55:45 -0500 (Wed, 30 Jan 2008)
New Revision: 13344

Modified:
   torbutton/trunk/src/components/cssblocker.js
   torbutton/trunk/src/defaults/preferences/preferences.js
Log:

Fix up content policy to not break form submits and favicons
(introduced in r13324).



Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js	2008-01-30 23:46:02 UTC (rev 13343)
+++ torbutton/trunk/src/components/cssblocker.js	2008-01-31 04:55:45 UTC (rev 13344)
@@ -181,7 +181,8 @@
         }
 
         var browser;
-        if(wind.top.opener) {
+        if(wind.top.opener && 
+            !(wind.top.opener instanceof Components.interfaces.nsIDOMChromeWindow)) {
             this.logger.log(3, "Popup found: "+contentLocation.spec);
             browser = this.wm.getBrowserForContentWindow(wind.top.opener.top)
         } else {
@@ -206,18 +207,20 @@
             if(wind.top.browserDOMWindow 
                     && contentType == CPolicy.TYPE_DOCUMENT) {
                 this.logger.log(3, "New location for "+contentLocation.spec+" (currently: "+wind.top.location+" and "+browser.currentURI.spec+")");
+                // Workaround for Firefox Bug 409737.
+                // This disables window.location style redirects if the tor state
+                // has changed
                 if(requestOrigin) {
+                    this.logger.log(3, "Origin: "+requestOrigin.spec);
                     var scheme = requestOrigin.spec.replace(/:.*/, "").toLowerCase();
                     if(scheme != "chrome") {
-                        // Workaround for Firefox Bug 409737
                         if(browser.__tb_tor_fetched == tor_state) {
                             return ok;
                         } else {
-                            this.logger.log(3, "Blocking: "+contentLocation.spec);
+                            this.logger.log(3, "Blocking redirect: "+contentLocation.spec);
                             return block;
                         }
                     }
-                    this.logger.log(3, "Origin: "+requestOrigin.spec);
                 }
                 return ok;
             }

Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js	2008-01-30 23:46:02 UTC (rev 13343)
+++ torbutton/trunk/src/defaults/preferences/preferences.js	2008-01-31 04:55:45 UTC (rev 13344)
@@ -73,7 +73,7 @@
 pref("extensions.torbutton.startup",false);
 pref("extensions.torbutton.crashed",false);
 pref("extensions.torbutton.clear_http_auth",true);
-pref("extensions.torbutton.close_on_toggle",true);
+pref("extensions.torbutton.close_on_toggle",false);
 pref("extensions.torbutton.block_js_history",true);
 
 pref("extensions.torbutton.appname_override","Netscape");