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:
parent
937492f6f5
commit
8d8f78241d
11 changed files with 39 additions and 37 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue