1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Add native lazy loading for images and iframes

This feature is available only in Chrome >= 76 for now.

See https://web.dev/native-lazy-loading
This commit is contained in:
Frédéric Guillot 2019-09-10 21:12:38 -07:00 committed by Frédéric Guillot
parent 937492f6f5
commit 8d8f78241d
11 changed files with 39 additions and 37 deletions

View file

@ -137,7 +137,9 @@ func getExtraAttributes(tagName string) ([]string, []string) {
case "video", "audio":
return []string{"controls"}, []string{"controls"}
case "iframe":
return []string{"sandbox"}, []string{`sandbox="allow-scripts allow-same-origin allow-popups"`}
return []string{"sandbox", "loading"}, []string{`sandbox="allow-scripts allow-same-origin allow-popups"`, `loading="lazy"`}
case "img":
return []string{"loading"}, []string{`loading="lazy"`}
default:
return nil, nil
}