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

[or-cvs] r14767: Try to store the window dimensions earlier so we don't end u (torbutton/trunk/src/chrome/content)



Author: mikeperry
Date: 2008-05-28 00:47:15 -0400 (Wed, 28 May 2008)
New Revision: 14767

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

Try to store the window dimensions earlier so we don't end up
with 0x0 windows. Also fix a pref checking issue for full
page plugins.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-05-28 04:47:12 UTC (rev 14766)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-05-28 04:47:15 UTC (rev 14767)
@@ -10,8 +10,8 @@
 var m_tb_plugin_string = false;
 var m_tb_is_main_window = false;
 
-var m_tb_window_height = 0;
-var m_tb_window_width = 0;
+var m_tb_window_height = window.outerHeight;
+var m_tb_window_width = window.outerWidth;
 
 var m_tb_ff3 = false;
 
@@ -799,7 +799,7 @@
         // XXX: save user pref
         m_tb_prefs.setIntPref("browser.bookmarks.livemark_refresh_seconds", 0);
     } else {
-        if(m_tb_prefs.prefHasUserValue("plugin.disable_full_page_plugin_for_types")) {
+        if(m_tb_prefs.prefHasUserValue("browser.bookmarks.livemark_refresh_seconds")) {
             m_tb_prefs.clearUserPref("browser.bookmarks.livemark_refresh_seconds");
         }
     }
@@ -1840,6 +1840,10 @@
 {
     torbutton_log(3, "New window");
     var browser = getBrowser(); 
+
+    m_tb_window_height = window.outerHeight;
+    m_tb_window_width = window.outerWidth;
+
     if (!m_tb_wasinited) {
         torbutton_init();
     }
@@ -1853,9 +1857,6 @@
             !m_tb_prefs.getBoolPref("extensions.torbutton.tor_enabled"),
             m_tb_prefs.getBoolPref("extensions.torbutton.no_tor_plugins"));
 
-    m_tb_window_height = window.outerHeight;
-    m_tb_window_width = window.outerWidth;
-
     window.addEventListener("resize", torbutton_do_resize, true);
 }
 
@@ -1890,11 +1891,9 @@
         torbutton_unique_pref_observer.unregister();
         torbutton_uninstall_observer.unregister();
         torbutton_http_observer.unregister();
-
     }
 }
 
-// XXX: Firefox3 might not support this??
 window.addEventListener('load',torbutton_new_window,false);
 window.addEventListener('unload', torbutton_close_window, false);
 getBrowser().addEventListener("TabOpen", torbutton_new_tab, false);