Skip to content

Commit

Permalink
Chromium: Take screenshot when body is ready
Browse files Browse the repository at this point in the history
This should wait for all images to be loaded before taking a screenshot
  • Loading branch information
lastzero authored Oct 16, 2021
1 parent 225e22f commit d3cc1b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions chromium/chromium.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func takeScreenshot(res *[]byte, html string, width float64, height float64) chr
return nil

}),
chromedp.WaitReady("body"),
chromedp.ActionFunc(func(ctx context.Context) error {

_, _, contentSize, err := page.GetLayoutMetrics().Do(ctx)
Expand Down

0 comments on commit d3cc1b5

Please sign in to comment.