Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load screenshots #339

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Conversation

kevin-brotcke
Copy link
Contributor

@kevin-brotcke kevin-brotcke commented Oct 27, 2023

All screenshots are loaded immediately when opening the report even if they aren't in view. When opening a large report hosted remotely containing thousands of screenshots it can take several minutes to load. A quick fix is to enable native image lazy loading which is supported in most popular browsers today.

All screenshots are loaded immediately when opening the report even if they aren't in view. When opening a large report hosted remotely containing thousands of screenshots it can take several minutes to load. A quick fix is to enable native image lazy loading which is supported in most popular browsers today.
@kevin-brotcke
Copy link
Contributor Author

As a workaround we're currently doing sed -i '' 's/<img /<img loading="lazy" /g' index.html manually and it's improved performance but it would be great to push this upstream so we can remove it.

@tylervick
Copy link
Member

Thank you for the PR! I was unfamiliar with the loading attr but it seems it's supported on all major browsers now: https://caniuse.com/loading-lazy-attr

@tylervick tylervick merged commit 8290f5e into XCTestHTMLReport:main Nov 10, 2023
2 checks passed
@kevin-brotcke kevin-brotcke deleted the patch-1 branch November 13, 2023 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants