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
- sub-frame: c.com/foo.jsp
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
}
精彩评论