In Google Chrome's Dev tools there's a simple dropdown to choose which window you want to execute your script in:
Is there an equivalent in Internet Explorer? I'm trying to run scripts from the console as if they're from an iframe, not the toplevel window.
It is possible, however it’s significantly less convenient than in Chrome.
If you’re able to get a reference to the frame or its window
object (using, e.g.: document.getElementById(xxx).contentWindow
), you can use the console’s special cd
function. This is documented here: http://msdn.microsoft.com/en-us/library/ie/gg589530(v=vs.85).aspx#UsingCDacrossFrames
Annoyingly, this means that if you want to get a reference to a nested iframe, you have to do this inside each each of the parents of the frame that you’re interested in. Debugging in IE is, erm, fun.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With