[or-cvs] r13554: Fix file urls. Also, forgot to check window was not minimize (in torbutton/trunk/src: chrome/content components)

mikeperry at seul.org mikeperry at seul.org
Mon Feb 18 11:05:19 UTC 2008


Author: mikeperry
Date: 2008-02-18 06:05:19 -0500 (Mon, 18 Feb 2008)
New Revision: 13554

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

Fix file urls. Also, forgot to check window was not
minimized/maximized in a couple of resize to 50pix cases.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-02-18 10:59:16 UTC (rev 13553)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-02-18 11:05:19 UTC (rev 13554)
@@ -1177,8 +1177,11 @@
     if(m_tb_prefs.getBoolPref("extensions.torbutton.tor_enabled")
             && m_tb_prefs.getBoolPref("extensions.torbutton.resize_on_toggle")) {
         var bWin = window.getBrowser().contentWindow;
-        bWin.innerHeight = Math.round(bWin.innerHeight/50.0)*50;
-        bWin.innerWidth = Math.round(bWin.innerWidth/50.0)*50;
+        if(window.windowState 
+                == Components.interfaces.nsIDOMChromeWindow.STATE_NORMAL) {
+            bWin.innerHeight = Math.round(bWin.innerHeight/50.0)*50;
+            bWin.innerWidth = Math.round(bWin.innerWidth/50.0)*50;
+        }
     }
 }
 
@@ -1340,8 +1343,11 @@
         // We need to do the resize here as well in case the window
         // was minimized during toggle...
         if(!tor_tag && m_tb_prefs.getBoolPref("extensions.torbutton.resize_on_toggle")) {
-            win.top.innerHeight = Math.round(win.top.innerHeight/50.0)*50;
-            win.top.innerWidth = Math.round(win.top.innerWidth/50.0)*50;
+            if(win.windowState 
+                    == Components.interfaces.nsIDOMChromeWindow.STATE_NORMAL) {
+                win.top.innerHeight = Math.round(win.top.innerHeight/50.0)*50;
+                win.top.innerWidth = Math.round(win.top.innerWidth/50.0)*50;
+            }
         }
     }
 

Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js	2008-02-18 10:59:16 UTC (rev 13553)
+++ torbutton/trunk/src/components/cssblocker.js	2008-02-18 11:05:19 UTC (rev 13554)
@@ -170,7 +170,7 @@
             }
         } else if(scheme == "resource" || scheme == "data" || scheme == "cid" 
                 || scheme == "javascript") {
-            if(origScheme && origScheme == "chrome") {
+            if(origScheme && (origScheme == "chrome" || origScheme == "file")) {
                 this.logger.eclog(1, "Skipping chrome-sourced local: "+cleanContentLoc);
                 return ok;
             } else if(this.tor_enabled) {



More information about the tor-commits mailing list