I try to fit iframe size with content and use lib https://github.com/davidjbradshaw/iframe-resizer
So, I created react component:
import React from "react";
import IframeResizer from "react-iframe-resizer-super";
const IFrameArea = () => {
const url = "http://localhost:8080/app/jsf/data-payments.jsf";
const iframeResizerOptions = {
log: true,
checkOrigin: false,
};
return (
<IframeResizer src={url} iframeResizerOptions={iframeResizerOptions}/>
);
};
export default IFrameArea;
and in header for all jsf-s inserted this
<h:outputScript library="iframeResizer" name="iframeResizer.contentWindow.js" />
So, I expected, that my component send message to content. Content will response using this iframeResizer.contentWindow.js and iframe will be resized. But there is
[iFrameSizer][Host page: iFrameResizer0] No response from iFrame. Check iFrameResizer.contentWindow.js has been loaded in iFrame
error message. So, can you help me, whats wrong? p.s. I use this libriary
name="iframeResizer.contentWindow.js - is just path to js-lib
library - library name, you can use that already exists in your app.