davidjbradshaw / iframe-resizer

Keep iFrames sized to their content.
https://iframe-resizer.com
Other
6.65k stars 981 forks source link

iframe resizer doesnt work on particular iframe links #1146

Closed kasisathya closed 6 months ago

kasisathya commented 1 year ago
<iframe src="Url-1"></iframe>

When am loading a page with the above iframe then iframeresizer works fine but when am loading the page with different Urls suppose

<iframe src="Url-2"></iframe>
<iframe src="Url-3"></iframe>
<iframe src="Url-4"></iframe>

For non of these the resizer works

The log stops till here:

[iFrameSizer][Host page: serviceBookingIframe] IFrame scrolling disabled for serviceBookingIframe
[iFrameSizer][Host page: serviceBookingIframe] [init] Sending msg to iframe[serviceBookingIframe] (serviceBookingIframe:8:false:true:32:true:true:null:max:null:null:0:false:parent:scroll:true) targetOrigin: https://somedomain.com
[iFrameSizer][Host page: serviceBookingIframe] IFrame has not responded within 5 seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.
davidjbradshaw commented 1 year ago

From the log message

Check iFrameResizer.contentWindow.js has been loaded in iFrame
kasisathya commented 1 year ago

Yes did check but iFrameResizer.contentWindow.js is not loaded into the page However with the same logic Here the script loads successfully

kasisathya commented 1 year ago

The second file (iframeResizer.contentWindow.min.js) needs placing in the page(s) contained within your iFrame.

As per this statement, does it means this file needs to be present in the page which we are loading through iframe url? In my eg: The page which is loaded through Url-2 needs to have above mentioned script loaded in it?

davidjbradshaw commented 1 year ago

Yes every page you load into the iframe