1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-19 21:28:32 +02:00

Fixed use of deprecated CDP API methods ()

This commit is contained in:
Tim Voronov 2021-07-16 23:45:18 -04:00 committed by GitHub
parent 1d64cb5da7
commit 53bcfc92d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions
pkg/drivers/cdp

@ -78,8 +78,8 @@ func getClickablePoint(ctx context.Context, client *cdp.Client, qargs *dom.GetCo
return Quad{}, err
}
clientWidth := layoutMetricsReply.LayoutViewport.ClientWidth
clientHeight := layoutMetricsReply.LayoutViewport.ClientHeight
clientWidth := layoutMetricsReply.CSSLayoutViewport.ClientWidth
clientHeight := layoutMetricsReply.CSSLayoutViewport.ClientHeight
quads := make([][]Quad, 0, len(contentQuadsReply.Quads))

@ -478,11 +478,11 @@ func (p *HTMLPage) CaptureScreenshot(ctx context.Context, params drivers.Screens
}
if params.Width <= 0 {
params.Width = values.Float(metrics.LayoutViewport.ClientWidth) - params.X
params.Width = values.Float(metrics.CSSLayoutViewport.ClientWidth) - params.X
}
if params.Height <= 0 {
params.Height = values.Float(metrics.LayoutViewport.ClientHeight) - params.Y
params.Height = values.Float(metrics.CSSLayoutViewport.ClientHeight) - params.Y
}
clip := page.Viewport{