Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 5978: Firebug does not show javascript from iframes.

  • Loading branch information...
commit df926d82b9f920ed770cf9030d36c589af3ae2b7 1 parent 72c45d1
@janodvarko janodvarko authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 extension/content/firebug/chrome/window.js
View
10 extension/content/firebug/chrome/window.js
@@ -101,9 +101,17 @@ Win.getRootWindow = function(win)
{
for (; win; win = win.parent)
{
- if (!win.parent || win == win.parent || !(win.parent instanceof win.Window) )
+ if (!win.parent || win == win.parent)
+ return win;
+
+ // When checking the 'win.parent' type we need to use the target
+ // type from the same scope. i.e. from win.parent
+ // Iframes from different domains can use different Window type than
+ // the top level window.
+ if (!(win.parent instanceof win.parent.Window))
return win;
}
+
return null;
};

4 comments on commit df926d8

@simonlindholm

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.

@janodvarko
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

@simonlindholm

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

@janodvarko
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.