My webpage(wp1) has an iframe. The source of the iframe is another webpage(wp2). I have some javascript functions on wp1 which try to manipulate the contents of wp2. However , the browser gives " Blocked a frame with origin "null" from accessing a cross-origin frame." How can i get around this?
Asked
Active
Viewed 1,396 times
0
-
@C0dekid — That won't help. – Quentin Jun 20 '17 at 10:23
1 Answers
1
According to the MDN page about postMessage, if your parent and child domains differ only by a subdomain (e.g example.com
and subdomain.example.com
), you can set document.domain
to the same value on both pages and it should be enough to get it to work.
Accepted value for document.domain
is that of the superdomain (example.com
= ok, subdomain.example.com
= nope), according to Same Origin Policy.

Watilin
- 286
- 3
- 9