No bug JCHoptimize of iframes thwarts ochFitvids
- Tim Davis
-
Onderwerp Auteur
- Offline
Minder
Lees meer
- Berichten: 54
- Ontvangen bedankjes 1
4 jaren 6 maanden geleden - 4 jaren 6 maanden geleden #1482
door Tim Davis
JCHoptimize of iframes thwarts ochFitvids werd gestart door Tim Davis
Hi Ruud,
I have discovered that when JCHoptimize is set to lazy load iframes, och Fitvids does not work. Just letting you know.
Here is a sample iframe code with JCH lazyload fingerprints on it:
I have discovered that when JCHoptimize is set to lazy load iframes, och Fitvids does not work. Just letting you know.
Here is a sample iframe code with JCH lazyload fingerprints on it:
Code:
<div class="responsive-video"><iframe class="jch-lazyload" src="about:blank" data-src="https://www.youtube.com/embed/e9yE7ZyNUDs" width="560" height="315" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
Laatst bewerkt 4 jaren 6 maanden geleden doorTim Davis.
Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1707
- Ontvangen bedankjes 111
4 jaren 6 maanden geleden #1484
door Ruud van Lent
Beantwoord door Ruud van Lent in topic JCHoptimize of iframes thwarts ochFitvids
Hi Tim,
JCH is known (at least for me) to rule the web as they are the only extension installed. When there are issues with extensions / plugins first question i ask is always is JCH Optimize installed: if yes, turn it off and see if that fixes the issue.
That said: What I see in the iframe code you provided, JCH is using a very 'old fashioned' lazyloading via a javascript. There are currently lazy loading standards introduced in all (modern) browsers that do not break the web.
JCH Optimize breaks the iframe by removing the src attribute. by doing that the iFrame cannot load because there is nothing to load. When the broken iFrame comes into to view, JCH repairs the iFrame by re-adding the src attribute.
Long ago, that was a very tricky lazy loading implementation. Since then the world has moved on and lazy loading is now a browser standard. You can simply add the loading="lazy" attribute to any iFrame and the browser will handle it as such.
like this:
ochFitVids requires a intact iFrame as a broken iFrame is no iFrame
JCH is known (at least for me) to rule the web as they are the only extension installed. When there are issues with extensions / plugins first question i ask is always is JCH Optimize installed: if yes, turn it off and see if that fixes the issue.
That said: What I see in the iframe code you provided, JCH is using a very 'old fashioned' lazyloading via a javascript. There are currently lazy loading standards introduced in all (modern) browsers that do not break the web.
JCH Optimize breaks the iframe by removing the src attribute. by doing that the iFrame cannot load because there is nothing to load. When the broken iFrame comes into to view, JCH repairs the iFrame by re-adding the src attribute.
Long ago, that was a very tricky lazy loading implementation. Since then the world has moved on and lazy loading is now a browser standard. You can simply add the loading="lazy" attribute to any iFrame and the browser will handle it as such.
like this:
Code:
<iframe src="video-player.html" title="..." loading="lazy"></iframe>
ochFitVids requires a intact iFrame as a broken iFrame is no iFrame

Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1707
- Ontvangen bedankjes 111
4 jaren 6 maanden geleden #1488
door Ruud van Lent
Beantwoord door Ruud van Lent in topic JCHoptimize of iframes thwarts ochFitvids
Maybe I can have ochFitVids set the loading='lazy' element on iFrames it finds and processes. That way you have optimum sized videos AND lay loading conform latest standards (which Google likes as this is a standard I believe they introduced, or took part in).
Graag Inloggen deelnemen aan het gesprek.