开发者

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

开发者 https://www.devze.com 2023-03-04 20:14 出处:网络
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.

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

精彩评论

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

关注公众号