I am trying to get an iframe ( https://booking.yourdomain.com from https://www.yourdomain.com ) so that I can set its height. So, all the content is visible like this (I accepted the expression from here ):
var booking_iframe = document.querySelector('iframe');
booking_iframe.onload = function() {
booking_iframe.style.height = booking_iframe.contentWindow.document.body.offsetHeight + 'px';
}
But this causes the following error:
VM389:1 Uncaught DOMException: Blocked a frame with origin "https://www.yourdomain.com" from accessing a cross-origin frame.
at <anonymous>:1:54
Domains and protocol are the same, but the subdomain isn’t working,
Any suggestion?
(If you want to play with the debugger, I created test.html using only iframes in the production environment)
-Edit -
As a workaround: Any idea how to enable iframe content scrolling? (tried fixed height and overflow, scroll = yes, but will not work)