Hi, I am having an issue with getting the height of an iframe's body element through jQuery. It works in Chromium based browsers as intended, but it returns 0 as the height (in bdyheight). I was asked by a Safari developer to post this here. If there is a workaround that is known, please let me know! Here's the code: <iframe id="dbframe" src="https://transitiontn.org/assessment-database-vr/" width="100%" scrolling="no" > <script> jQuery("#dbframe").on("load", function() { let head = jQuery(this).contents().find("head"); let css = '<style>#top-header, #main-header, #main-footer{display: none;}#page-container{padding-top: 0!important;} </style>'; jQuery(head).append(css); let bdyheight = jQuery(this).contents().find("body").height(); jQuery(this).height(bdyheight); let dblinks = jQuery(this).contents().find("td a"); jQuery(dblinks).click(function() { jQuery("html").animate({scrollTop: 0 }, 800); window.setTimeout(function(){jQuery("#dbframe").height(2000)}, 2000); }); }); </script> Thank you!
<rdar://problem/66848144>
Could you post a link to a self-contained example please?
(In reply to Simon Fraser (smfr) from comment #2) > Could you post a link to a self-contained example please? This is the page we are trying to get working. https://transitiontn.org/vr/assessment-db/
Here's one issue, possibly unrelated: [Warning] [blocked] The page at https://transitiontn.org/vr/assessment-db/ was not allowed to run insecure content from http://transitiontn.org/wp-content/themes/Divi-child/js/jquery.sticky.js.
For some reason the display type of the <body> in the iframe ends up as "inline".
(In reply to Simon Fraser (smfr) from comment #4) > Here's one issue, possibly unrelated: > [Warning] [blocked] The page at https://transitiontn.org/vr/assessment-db/ > was not allowed to run insecure content from > http://transitiontn.org/wp-content/themes/Divi-child/js/jquery.sticky.js. That issue has been fixed, but it appears to have had no effect.
Adding this bug as it may be of the same origin: https://bugs.webkit.org/show_bug.cgi?id=222622