When the script is executed, the HTML parse has not finished and therefore the iframe is not loaded. Since the iframe is already on the screen, there is no scroll event to "load the iframe"
When I change to defer, it worked. Would it be interesting to change it to defer?
We have a site with iframes at the top and they sometimes don't load. I believe this is because of the use of
async
here:https://github.com/collective/collective.lazysizes/blob/da01ba870c754ea1e623e7450a25a5ba5ca50199/webpack/app/resources.pt#L2
When the script is executed, the HTML parse has not finished and therefore the iframe is not loaded. Since the iframe is already on the screen, there is no scroll event to "load the iframe"
When I change to
defer
, it worked. Would it be interesting to change it todefer
?