开发者

How could javascript figure out the (i)frame hierarchy?

How could chrome extension javascript figure out the whole page (i)frame hierarchy?

Please remember users can click links and the sub frames could be in any lo开发者_如何学编程cation.

In the end the extension needs to know:

  • root: B.com/blah.html
    • sub-frame: c.com/foo.jsp
      • sub-frame: d.com/bar.asp
      • sub-frame: e.com/index.html


i think you have to somthing like this , just change the ** elementID ** :

 var parents = $("#elementID").parents("*");

  for (i = parents.length - 1; i >= 0; i--) {

   //your code
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜