diff options
| author | 2025-06-03 00:14:50 +0200 | |
|---|---|---|
| committer | 2025-06-03 00:14:50 +0200 | |
| commit | dd5ea7ab4ef5fd7553fef15ebbb13504d0d881ad (patch) | |
| tree | 45d50e82468614f2236f49e0b3dbbc0a98ed467e /p/scripts | |
| parent | 58a264db4007971b36c6b058287c9d43e9c8443a (diff) | |
Include remaining tags/attributes for lazy loading (#7636)
* Include remaining tags/attributes for lazy loading
* Suggested change
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/main.js | 8 |
1 files changed, 6 insertions, 2 deletions
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'); }); } |
