Skip to content

Commit

Permalink
feat: await document.fonts.ready before screenshot (garris#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Apr 30, 2024
1 parent 6d0e5fe commit bf413fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/util/runPlaywright.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ async function captureScreenshot (page, browserContext, selector, selectorMap, c
ensureDirectoryPath(filePath);

try {
await page.waitForFunction(() => document.fonts.ready);
await page.screenshot({
path: filePath,
fullPage
Expand Down
1 change: 1 addition & 0 deletions core/util/runPuppet.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ async function captureScreenshot (page, browser, selector, selectorMap, config,
ensureDirectoryPath(filePath); // logs in same dir

try {
await page.waitForFunction(() => document.fonts.ready);
await page.screenshot({
path: filePath,
fullPage
Expand Down

0 comments on commit bf413fb

Please sign in to comment.