A photo gallery fits neatly inside a 600-pixel iframe. Then someone opens the comments panel. The submit button disappears below the frame, a second scrollbar appears, and the host page has no idea anything changed.
Increasing the default height only moves the problem. A narrow screen produces more grid rows. A different language wraps captions onto extra lines. Client photo selection changes the visible content.
This is a practical integration problem for photo and video client galleries , where reviewing and downloading happen inside the same interface. The implementation below is a standalone design for a service you control, not a description of any particular product’s internals.
Let the child measure and the parent decide
The host cannot inspect a cross-origin iframe’s DOM. Instead, the embedded page measures its content and sends a small message. The parent validates that message before updating the iframe.
The browser provides this communication channel through window.postMessage() .…