npm / iframe-resizer
iframe-resizer
What changed in iframe-resizer 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
10 breaking16 deprecations5 new APIs and options4 behavior and defaults9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initiframe-resizer 544 changes
Breaking changes 10
Content changes are detected with newer browser APIs, improving performance and event detection and preventing one change from being picked up by multiple browser events.
A consolidated tag attribute replaces the separate data-iframe-height and data-iframe-width attributes.
A single option consolidates resize direction, accepting vertical, horizontal, both, or none.
This method replaces getPageInfo and groups parent information into iframe, document, and viewport objects.
The jQuery plugin is split out into its own package.
The React package is renamed to this package name.
Support for legacy browsers is dropped, enabling use of newer browser APIs for content change detection.
This option has been removed because target browsers support setting these constraints on the iframe via CSS.
This option has been removed because target browsers support setting these constraints on the iframe via CSS.
This option has been removed because target browsers support setting these constraints on the iframe via CSS.
Deprecations 16
The old direction-setting value is deprecated in favor of the direction option.
This old tag attribute is deprecated in favor of the consolidated data-iframe-size tag.
This old tag attribute is deprecated in favor of the consolidated data-iframe-size tag.
This method is deprecated in favor of getParentProps.
This option is deprecated; iframe-resizer inspects page layout to automatically select the best content size calculation method when the iframe is resized.
The Parent Page API callback is renamed from onClosed.
The Parent Page API callback is renamed from onClose.
The Parent Page API callback is deprecated in favor of onBeforeClose.
The Parent Page API callback is deprecated in favor of onAfterClose.
The Parent Page API callback is deprecated in favor of onReady.
The Parent Page API callback is renamed from onInit to align parent and child event names.
The Child Page API method is renamed from size to resize to align with the Parent Page API.
The Child Page API method is deprecated in favor of resize.
The old direction-setting value is deprecated in favor of the direction option.
The old direction-setting value is deprecated in favor of the direction option.
This option is deprecated; iframe-resizer inspects page layout to automatically select the best content size calculation method when the iframe is resized.
New APIs and options 5
The former combined package is split into a child package that can be upgraded independently and remains backwards compatible with previous versions.
The former combined package is split into a parent package that can be upgraded independently and remains backwards compatible with previous versions.
This option adjusts the value returned by the iframe for the dimension being resized; it accepts a positive or negative value.
This event lets you modify or replace the content size before it is sent to the parent, replacing custom size functions on the calculation method options.
TypeScript types are included in the Parent, Child, and React NPM packages.
Behavior and default changes 4
The connection timeout warning now includes checkOrigin.
Iframe-resizer inspects the iframe html and body elements and ensures their height and width are set to auto to avoid resizing difficulties or loops.
Iframe and parent page visibility are observed so resizing can be disabled while the iframe is not visible to the user.
Same-domain iframe messages are passed directly via the browser DOM; postMessage is used only for cross-domain iframes.
Fixes and other changes 9
Initialization is now supported for disconnected iframes.
Fixes rafId not being cleared after cancelAnimationFrame.
The calc mode warning message for a V4 parent page was fixed.
The library now checks for duplicate iframe IDs.
Event listeners in the child page are automatically torn down.
Visibility state now uses the last IntersectionObserver entry.
The height and width values returned by this event are now numbers instead of strings.
The height and width values returned by this event are now numbers instead of strings.
The height and width values returned by this event are now numbers instead of strings.