collective / collective.lazysizes

Integration of lazysizes, a lightweight lazy loader, into Plone.
https://pypi.org/project/collective.lazysizes
6 stars 2 forks source link

iframes at top of the page are not loaded #86

Open wesleybl opened 1 year ago

wesleybl commented 1 year ago

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 to defer?