Updates the containing iFrame's height to match the height of the content.
The resizeIframe function updates your extension's <iframe> height to match the height of the content. It uses document.body.scrollHeight or document.documentElement.scrollHeight (Whichever is smaller) and applies the height to the style attribute of the <iframe>.
Tecton will automatically fire this in the background on the page load and resize events. Additionally, we apply a ResizeObserver to watch for changes to the height of the document.body and update the <iframe> height from those as well.
This is also why we advise against setting a height or max-height on elements that contain the content (e.g., document, body, <main>), as that will override the container's ability to update, sometimes forcing an inner scrollbar.
Type
tecton.actions.resizeIframe(): void;
Example
tecton.actions.resizeIframe();There are 2 frequently asked questions related to this page.
Initial Release
Use ResizeObserver to detect changes
Take margins on <body> tag into consideration