[tor-commits] [torbutton/master] Bug #3879: Framed sites broken (yopmail, gmane, gmaps, etc)

mikeperry at torproject.org mikeperry at torproject.org
Fri Sep 2 00:34:54 UTC 2011


commit 709c3fb7ef212e9b1b75db3d0a8512e4b03474ff
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Thu Sep 1 17:28:18 2011 -0700

    Bug #3879: Framed sites broken (yopmail, gmane, gmaps, etc)
    
    We were accidentally clearing the name attribute of framesets because we got
    notification before the referrer could be set on the channel.
---
 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 ee4b03e..6496895 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -4232,9 +4232,12 @@ function torbutton_hookdoc(win, doc, state_change, referrer) {
         // This keeps window.name clean between fresh urls.
         // It should also apply to iframes because hookdoc gets called for all
         // frames and subdocuments.
-        if (!referrer || referrer.spec == "") {
-            win.name = null;
-            win.window.name = null;
+        //
+        // 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 = "";
         }
     } catch(e) {
         torbutton_log(4, "Failed to reset window.name: "+e)



More information about the tor-commits mailing list