function updateParentHeight() {
const height = document.documentElement.scrollHeight;
window.parent.postMessage({
type: 'resize',
height: height
}, '*');
}
// Call on load
window.addEventListener('load', updateParentHeight);
// Call on any DOM changes
const observer = new MutationObserver(updateParentHeight);
observer.observe(document.body, {
childList: true,
subtree: true
});