Hi,
I have a website with 4 domains, one for each language. It uses Wordpress and WPML. The page builder is using an iFrame to preview the page content, on their own domain.
I tried to add in my .htaccess
- Header Set Content-Security-Policy frame-ancestors https://DOMAIN1.com https://DOMAIN2.com (with and without https)
- Header Set Content-Security-Policy frame-src https://DOMAIN1.com https://DOMAIN2.com (with and without https)
- Header set Access-Control-Allow-Origin "*"
But it still does not work.
This is an easy code I used to reproduce the issues :
<iframe id="elementor-preview-iframe" src="https://DOMAIN2.COM/test.txt" allowfullscreen="1"></iframe>
<button onclick="document.getElementById('elementor-preview-iframe').contentWindow.print();">Test</button>
When I call https://DOMAIN1.COM/script.html and click on the button, I have :
Uncaught DOMException: Blocked a frame with origin "https://DOMAIN1.COM" from accessing a cross-origin frame.
When I call it from DOMAIN2.COM/script.html, everything works as expected.
Do you have any clues?
Thanks!
I have a website with 4 domains, one for each language. It uses Wordpress and WPML. The page builder is using an iFrame to preview the page content, on their own domain.
I tried to add in my .htaccess
- Header Set Content-Security-Policy frame-ancestors https://DOMAIN1.com https://DOMAIN2.com (with and without https)
- Header Set Content-Security-Policy frame-src https://DOMAIN1.com https://DOMAIN2.com (with and without https)
- Header set Access-Control-Allow-Origin "*"
But it still does not work.
This is an easy code I used to reproduce the issues :
<iframe id="elementor-preview-iframe" src="https://DOMAIN2.COM/test.txt" allowfullscreen="1"></iframe>
<button onclick="document.getElementById('elementor-preview-iframe').contentWindow.print();">Test</button>
When I call https://DOMAIN1.COM/script.html and click on the button, I have :
Uncaught DOMException: Blocked a frame with origin "https://DOMAIN1.COM" from accessing a cross-origin frame.
When I call it from DOMAIN2.COM/script.html, everything works as expected.
Do you have any clues?
Thanks!