From dd5ea7ab4ef5fd7553fef15ebbb13504d0d881ad Mon Sep 17 00:00:00 2001 From: Inverle Date: Tue, 3 Jun 2025 00:14:50 +0200 Subject: Include remaining tags/attributes for lazy loading (#7636) * Include remaining tags/attributes for lazy loading * Suggested change --- p/scripts/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index c0e31ef98..3e825ff96 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -431,8 +431,12 @@ const freshrssOpenArticleEvent = document.createEvent('Event'); freshrssOpenArticleEvent.initEvent('freshrss:openArticle', true, true); function loadLazyImages(rootElement) { - rootElement.querySelectorAll('img[data-original], iframe[data-original]').forEach(function (el) { - el.src = el.getAttribute('data-original'); + rootElement.querySelectorAll('img[data-original], iframe[data-original], video[data-original]').forEach(function (el) { + if (el.tagName === 'VIDEO') { + el.poster = el.getAttribute('data-original'); + } else { + el.src = el.getAttribute('data-original'); + } el.removeAttribute('data-original'); }); } -- cgit v1.2.3