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

[tor-commits] [torbutton/master] Bug #4058: Fix yet more issues with links opening in new tabs



commit c725da03ecc54934eb52582a785ccedd4c012b4b
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date:   Sat Oct 1 20:39:06 2011 -0700

    Bug #4058: Fix yet more issues with links opening in new tabs
    
    Fix is to only clear window.name for top-level windows, and to ignore
    frames/iframes.
---
 src/chrome/content/torbutton.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index decc37c..a9b8b59 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -4375,14 +4375,17 @@ function torbutton_hookdoc(win, doc, state_change, referrer) {
         // The about:blank check handles the 'name' attribute of framesets, which
         // get set before the referer is set on the channel.
         if ((!referrer || referrer.spec == "") && win.location != "about:blank") {
-            win.name = "";
-            win.window.name = "";
+            if (win.top == win.window) {
+                // Only reset if we're the top-level window
+                torbutton_log(4, "Resetting window.name: "+win.name+" for "+win.location);
+                win.name = "";
+                win.window.name = "";
+            }
         }
     } catch(e) {
         torbutton_log(4, "Failed to reset window.name: "+e)
     }
 
-    
     var js_enabled = m_tb_prefs.getBoolPref("javascript.enabled");
 
     // No need to hook js if tor is off

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits