Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: waiting for lazy-loaded images always timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Mar 3, 2023
1 parent 5c784c3 commit e3a9bf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function waitForFontLoading() {

// Check if the images are loaded
function waitForImagesLoading() {
return Array.from(document.images).every((img) => img.complete);
const allImages = Array.from(document.images);
allImages.forEach(img => img.loading = "eager")
return allImages.every((img)=>img.complete);
}

type LocatorOptions = Parameters<Page["locator"]>[1];
Expand Down

0 comments on commit e3a9bf3

Please sign in to comment.