[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [torbutton/maint-1.2] In FF3.6, the new docShell attrs were merged into nsIDocShell.
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Sat, 12 Dec 2009 14:27:51 -0800
Subject: In FF3.6, the new docShell attrs were merged into nsIDocShell.
Commit: 9dbb8ae67f18c10ecb187cb70e6e3a4cf700cd3c
---
src/chrome/content/torbutton.js | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index ec9ad88..ec5acb4 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -16,6 +16,7 @@ var m_tb_window_width = window.outerWidth;
var m_tb_ff3 = false;
var m_tb_ff35 = false;
+var m_tb_ff36 = false;
var torbutton_window_pref_observer =
{
@@ -407,6 +408,12 @@ function torbutton_init() {
m_tb_ff35 = false;
}
+ if(versionChecker.compare(appInfo.version, "3.6a1") >= 0) {
+ m_tb_ff36 = true;
+ } else {
+ m_tb_ff36 = false;
+ }
+
// initialize preferences before we start our prefs observer
torbutton_init_prefs();
@@ -2008,7 +2015,8 @@ function torbutton_toggle_win_jsplugins(win, tor_enabled, js_enabled, isolate_dy
// Likewise for DNS prefetch
if(m_tb_ff35) {
- b.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
+ if(!m_tb_ff36)
+ b.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
b.docShell.allowDNSPrefetch = !b.__tb_tor_fetched
&& !tor_enabled;
}
@@ -2082,7 +2090,8 @@ function torbutton_tag_new_browser(browser, tor_tag, no_plugins) {
}
if (!tor_tag && m_tb_ff35) {
- browser.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
+ if (!m_tb_ff36) /* Unified with nsIDocShell in 3.6 */
+ browser.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
browser.docShell.allowDNSPrefetch = tor_tag;
}
@@ -2145,7 +2154,8 @@ function torbutton_conditional_set(state) {
if(b && b.docShell){
if(no_plugins) b.docShell.allowPlugins = false;
if(m_tb_ff35) {
- b.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
+ if (!m_tb_ff36) /* Unified with nsIDocShell in 3.6 */
+ b.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
b.docShell.allowDNSPrefetch = false;
}
} else {
@@ -3278,7 +3288,8 @@ function torbutton_update_tags(win, new_loc) {
* before the load, because we don't want prefetch to be enabled
* on tor tabs once we leave Tor. */
if(m_tb_ff35) {
- browser.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
+ if (!m_tb_ff36) /* Unified with nsIDocShell in 3.6 */
+ browser.docShell.QueryInterface(Ci.nsIDocShell_MOZILLA_1_9_1_dns);
browser.docShell.allowDNSPrefetch = tor_tag;
}
--
1.5.6.5