since we can easy control iframe height and width in the host page,SO WHY we need iframe-resizer?
The reason why I ask this question is someone ask us to use this library just because they want to control the iframe height and our site has been integrated as iframe in their site.
iframe {
height: 500px // or height: calc(100% - $headerHeight - $footerHeigth) or height: calc(100vh - $headerHeight - $footerHeigth) or
}
You only need the iframe-resizer library when the iframe content height is not known when the iframe is created. The parent window containing the iframe should not be able to access information such as the height of the iframe content due to sandboxing. If you know that the iframe will always be a fixed height (e.g. less than x px) or you do not mind having scrollbars or truncating the iframe content, then no, you do not need the library.
Most helpful comment
You only need the iframe-resizer library when the iframe content height is not known when the iframe is created. The parent window containing the iframe should not be able to access information such as the height of the iframe content due to sandboxing. If you know that the iframe will always be a fixed height (e.g. less than x px) or you do not mind having scrollbars or truncating the iframe content, then no, you do not need the library.