Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5978: Firebug does not show javascript from iframes.

  • Loading branch information...
commit df926d82b9f920ed770cf9030d36c589af3ae2b7 1 parent 72c45d1
Jan Odvarko authored October 12, 2012
10  extension/content/firebug/chrome/window.js
@@ -101,9 +101,17 @@ Win.getRootWindow = function(win)
101 101
 {
102 102
     for (; win; win = win.parent)
103 103
     {
104  
-        if (!win.parent || win == win.parent || !(win.parent instanceof win.Window) )
  104
+        if (!win.parent || win == win.parent)
  105
+            return win;
  106
+
  107
+        // When checking the 'win.parent' type we need to use the target
  108
+        // type from the same scope. i.e. from win.parent
  109
+        // Iframes from different domains can use different Window type than
  110
+        // the top level window.
  111
+        if (!(win.parent instanceof win.parent.Window))
105 112
             return win;
106 113
     }
  114
+
107 115
     return null;
108 116
 };
109 117
 

4 notes on commit df926d8

Simon Lindholm
Collaborator

win.parent instanceof window.Window should also work, I believe.
I guess we should go through all of our instanceofs and see if any have the same problem.

Jan Odvarko
Owner

I guess we should go through all of our instanceofs and see if any have the same problem.

Exactly, I have been also thinking about it.

Perhaps we could use win instanceof Ci.nsIDOMWindow instead?

Honza

Simon Lindholm
Collaborator

Did you try win.parent instanceof window.Window and/or win instanceof Ci.nsIDOMWindow to see if it helps with the crash?

Jan Odvarko
Owner

Did you try win.parent instanceof window.Window
Yep this works (this is what was there before, but broke the iframe scripts)

and/or win instanceof Ci.nsIDOMWindow to see if it helps with the crash?
Doesn't help, it still crashes

Honza

Please sign in to comment.
Something went wrong with that request. Please try again.