Question

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]....)

Was it helpful?

Solution

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])

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top