+ 4
Most of the time, <iframe> content cannot be accessed if not from same domain as the main page: this is a root security behaviour that can only be modified on server side by the document loaded in <iframe>... Google generaly doesn't allow such behaviour ^^ However, if you load an <iframe> with same host (domain) than the parent document (another html page in the same server), you can use DOM to edit it as any parts of your main (parent) page content... the only details making few differences, is that you have to access <iframe> sub-DOM through its main 'document' node (ie: <iframe> node have no Html elements node as direct child, but an equivalent to the root 'document' node wich hold the sub-DOM... <iframe> is a kind of 'window' object, and is included in the 'window' objects hierarchy). Workarounds are possible, by using proxy for example: the sub-content from another domain is requested on server side, and send to be loaded technically as same domain origin... throughout, the changes could be also done on server side, rather than user side (you're never sure if JS is available or even enabled on user side ;P)...
4th Nov 2017, 9:47 AM
visph
visph - avatar