fix(screenshot): avoid unnecessary work (#16035)

Do not evaluate when not hiding caret nor disabling animations.
This commit is contained in:
Dmitry Gozman 2022-07-29 09:23:02 -07:00 committed by GitHub
parent e07eb664a5
commit 03b0f911d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,9 @@ export class Screenshotter {
}
async _preparePageForScreenshot(progress: Progress, hideCaret: boolean, disableAnimations: boolean) {
if (!hideCaret && !disableAnimations)
return;
if (disableAnimations)
progress.log(' disabled all CSS animations');
await Promise.all(this._page.frames().map(async frame => {