We have a page loaded with http that loads an iframe with https. The two pages are on the same domain, except for the protocol.
(I know having an https iframe is a bad practice. I can't help that.)
When Javascript in the iframe tries to call a javascript function in the parent, it fails with this:
Unsafe JavaScript attempt to access frame with URL http://www.foo.com/homepage/ from frame with URL https://www.foo.com/homepage/en/loginModal.html. Domains, protocols and ports must match.
Is there any way this can be modified to work? Is it possible that using the "Access-Control-Allow-Origin" header will do this?
If we change the jsp for the main page so that it sets a response header like:
Access-Control-Allow-Origin: https://www.foo.com
Will that work?