Runtime module for auto-resizing [[html]] block iframes.
HTML blocks are rendered as iframes. This module listens for
postMessage events from those iframes and adjusts the iframe's
height to match its content, eliminating scrollbars.
The communication protocol uses a typed message with
type: "wdpr-html-block-resize" and a numeric height field.
DOM interactions:
Listens for message events on window
Matches e.source against iframe.html-block-iframe elements in the root
Sets iframe.style.height to the reported content height
The destroy() cleanup function removes the message listener.
Runtime module for auto-resizing
[[html]]block iframes.HTML blocks are rendered as iframes. This module listens for
postMessageevents from those iframes and adjusts the iframe's height to match its content, eliminating scrollbars.The communication protocol uses a typed message with
type: "wdpr-html-block-resize"and a numericheightfield. DOM interactions:messageevents onwindowe.sourceagainstiframe.html-block-iframeelements in the rootiframe.style.heightto the reported content heightThe
destroy()cleanup function removes the message listener.