'How to open https in iframe from http page?

I have main page which opens via http. On this page I open iframe with same domain but via https and get error message:

Blocked a frame with origin "https://example.com" from accessing a cross-origin frame

Is it possible?



Solution 1:[1]

If the main page (http) could access the iframe (https) it will be a security problem!

More informations this security feature: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

Just move the main page to https, it will solve your problem and secure your visitors.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1