This question already has an answer here:
I want to access an element inside an iFrame, but because of the way the iFrame is being called, I am not succeeding.
This is the target page (www1.k9webprotection.com/...).
The iframe is on a different subdomain:
<iframe src="http://license.k9webprotection.com/..." ...></iframe>
Setting a timeout or an event listener for when the iframe is loaded, did not help.
Both documents are placed on different (sub)domains, by default they are not able to interact via javascript.
You must set the
domain
of both documents to the same value.Put this somewhere in the
<head/>
of both pages:...then wait for the
onload
-event of the iframe and you should be able to access the document inside the iframe from the parent page(and vice versa).Sample-Script for GreaseMonkey(simply overwrites the body of the iframe):