I am writing a browser extension/add-in that traverses the complete html tree of the webpage. Essentially, I get the children of each node using node.childNodes and then call the traversing function recursively. This worked great until I came across an iframe. Even if the iFrame has content, node.childNodes always shows the iframe as having 0 children.
I have seen examples of how to handle this (for example http://pietschsoft.com/post/2004/08/12/JavaScript-How-to-get-value-from-nested-form-in-iframe.aspx), but these examples assume that I know the name or id of the iframe. However, the iframe might not have a name or id, just a src.