Permalink
Browse files

Issue 5978: Firebug does not show javascript from iframes.

  • Loading branch information...
janodvarko committed Oct 12, 2012
1 parent 72c45d1 commit df926d82b9f920ed770cf9030d36c589af3ae2b7
Showing with 9 additions and 1 deletion.
  1. +9 −1 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

This comment has been minimized.

Show comment
Hide comment
@simonlindholm

simonlindholm Oct 12, 2012

Member

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.

Member

simonlindholm replied Oct 12, 2012

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

This comment has been minimized.

Show comment
Hide comment
@janodvarko

janodvarko Oct 12, 2012

Member

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

Member

janodvarko replied Oct 12, 2012

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

This comment has been minimized.

Show comment
Hide comment
@simonlindholm

simonlindholm Nov 8, 2012

Member

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

Member

simonlindholm replied Nov 8, 2012

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

@janodvarko

This comment has been minimized.

Show comment
Hide comment
@janodvarko

janodvarko Nov 9, 2012

Member

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

Member

janodvarko replied Nov 9, 2012

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.