I have a https page ( https://example.com/main.php ) that has an iframe with a source without https ( http://example.com/inner.php ). Both files are on the same server - only one of them is accessible using https, and the other is not. I need a page without https in order to be able to run javascript on an https page main.phpusing code likeparent.myfunction()
However, when I try to do this, I get the following error:
Insecure JavaScript is trying to access the frame with the URL https://example.com/main.php from the frame with the URL http://example.com/inner.php . Domains, protocols, and ports must be consistent.
I installed document.domain = 'example.com'for both files, and I thought it would fix, but it is not. Is there a way to allow the frame to execute javascripts on the parent frame and vice versa? If so, what are the security implications of this?
PS: For those of you who suggest using https or http for both pages, I study this. However, due to the processes occurring on the iframe page, this may not be an option due to server loading problems.
source
share