Glen Little
Glen Little

Reputation: 7128

IE 11 Developer Tools - Focus in IFRAME?

In the console of the Developer Tools in Chrome, the 'focus' can be changed to an IFRAME using the dropdown selector, shown here:

Developer Tools in Chrome

How can that be done in Internet Explorer 11, in the F12 Developer Tools?

(I know that the contents of IFRAMEs can also be accessed using frames[0]....)

Upvotes: 6

Views: 5818

Answers (2)

Glen Little
Glen Little

Reputation: 7128

To move focus to the top window, use:

cd()

and to move to the first iframe, use:

cd(frame[0])

Seems like you cannot use cd(top.frame[1]) to move to a sibling frame. But if iframes are nested, can use cd(frame[0]) to move into the first one, then cd(frame[0]) again to move in the nested one.

It is nice that immediately after typing cd(frame[x]) the console echos back: Current window: www.server.com/path/page.aspx showing you the current frame's source URL.

Upvotes: 3

Andy Sterland
Andy Sterland

Reputation: 1936

In IE from versions 9 onwards you can use the cd() command in the console to change the frame targeting you need to pass in a reference to the frame.

cd(window.frames[0])

Upvotes: 5

Related Questions