Skip to content

Commit 651b62f

Browse files
committed
Removing IntersectionObserver method for manually lazy loading images. This can be done by the browser as iOS15.4+ now accepts the loading="lazy" attribute.
Tweets continue to use intersection method. If an image fails to download during a lazyload, replace with Dead Image ghost badge.
1 parent 0d2c7ed commit 651b62f

File tree

2 files changed

+63
-246
lines changed

2 files changed

+63
-246
lines changed

App/Misc/HTMLRenderingHelpers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ extension HTMLDocument {
185185
postContentImageCount += 1
186186

187187
if postContentImageCount > Self.immediatelyLoadedImageCount {
188-
// Defer loading for images beyond the immediately loaded count
189-
img["data-lazy-src"] = finalURL
190-
img["src"] = Self.transparentPixelPlaceholder
188+
// Defer loading for images beyond the immediately loaded count (browser handles lazy loading)
189+
img["loading"] = "lazy"
190+
img["src"] = finalURL
191191
} else {
192192
// Load immediately
193193
img["src"] = finalURL

0 commit comments

Comments
 (0)