[or-cvs] r12561: Some chrome windows are not browsers.. Need to handle this. (torbutton/trunk/src/components)

mikeperry at seul.org mikeperry at seul.org
Fri Nov 23 23:17:54 UTC 2007


Author: mikeperry
Date: 2007-11-23 18:17:54 -0500 (Fri, 23 Nov 2007)
New Revision: 12561

Modified:
   torbutton/trunk/src/components/cssblocker.js
   torbutton/trunk/src/components/window-mapper.js
Log:

Some chrome windows are not browsers.. Need to handle this.



Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js	2007-11-23 15:39:43 UTC (rev 12560)
+++ torbutton/trunk/src/components/cssblocker.js	2007-11-23 23:17:54 UTC (rev 12561)
@@ -185,7 +185,8 @@
             return block; 
         }
 
-        // This happens on the first load of a doc
+        // This happens on the first load of a doc and with non-browser
+        // chrome..
         if (typeof(browser.__tb_tor_fetched) == 'undefined') {
             this.logger.log(3, "Untagged window for "+contentLocation.spec);
             return ok;

Modified: torbutton/trunk/src/components/window-mapper.js
===================================================================
--- torbutton/trunk/src/components/window-mapper.js	2007-11-23 15:39:43 UTC (rev 12560)
+++ torbutton/trunk/src/components/window-mapper.js	2007-11-23 23:17:54 UTC (rev 12561)
@@ -99,8 +99,14 @@
 
   getBrowserForContentWindow: function(topContentWindow) {
       if(topContentWindow instanceof Components.interfaces.nsIDOMChromeWindow) {
-          this.logger.log(3, "Chrome browser found: "+topContentWindow.location);
-          return topContentWindow.getBrowser().selectedTab.linkedBrowser;
+          if(topContentWindow.browserDOMWindow) {
+              this.logger.log(3, "Chrome browser found: "
+                      +topContentWindow.location);
+              return topContentWindow.getBrowser().selectedTab.linkedBrowser;
+          }
+          // Allow strange chrome to go through..
+          this.logger.log(3, "Odd chome window"+topContentWindow.location);
+          return topContentWindow;
       }
 
       var cached = this.checkCache(topContentWindow);



More information about the tor-commits mailing list