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

后端 未结 6 2123
春和景丽
春和景丽 2020-11-29 20:42

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 th

6条回答
  •  隐瞒了意图╮
    2020-11-29 21:31

    Chrome 15 allows you to change the scope of the console. On the bottom of the console, next to the clear console button, there is a menu that says which will give a list of available frames:

    enter image description here

    Firefox has a similar feature currently in development:

    enter image description here


    You can also navigate across frames using the command line:

    var frame = document.getElementById("frame1").contentWindow;
    cd(frame);
    

提交回复
热议问题