From 284968c2da70c48052d7b23efb32ed6364581fb0 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 22 Sep 2026 21:44:38 +0200 Subject: planet: lazily load iframes This prevents the page from jumping during buildup. --- Info/9/3/Planet/templates/h5p-autoembed.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Info/9/3/Planet/templates/h5p-autoembed.js b/Info/9/3/Planet/templates/h5p-autoembed.js index c26c0c84..8c5128e8 100644 --- a/Info/9/3/Planet/templates/h5p-autoembed.js +++ b/Info/9/3/Planet/templates/h5p-autoembed.js @@ -9,6 +9,8 @@ for (const div of autoEmbedLinksDivs) { iframe.src = "https://" + "lernplattform.bycs.de/mod/hvp/embed.php?id=" + autoEmbedId; iframe.frameborder = div.frameborder ? div.frameborder : 0; iframe.allowfullscreen = div.allowfullscreen ? div.allowfullscreen : "allowfullscreen"; + // Lazily load the iframe + iframe.loading = "lazy"; iframe.title = autoEmbedLink.title; if (div.width) { iframe.width = div.width; -- cgit v1.2.3