Alex Rivera | Logout

Is there a way to change context to iframe in javascript console?

Asked 2011-11-01T00:22:21.267
127

I would like to change the context of the javascript executed in the webkit developer tool/firebug console to execute its code like it is running from inside an iframe on the page.

I know I could do this by opening the page in the iframe on a separate page, but I want to run code where it interacts with the parent frame.

Edit
Report

1 Answer

23

You can execute code in <iframe>s by using the window.frames[x] functionality. For example,

window.frames[0].runFunction()
answered 2011-11-01T01:30:27.587

Your Answer