fix: element screenshot issue in headful mode (#8018)

Fixes: #7999
This commit is contained in:
Alex Rudenko 2022-02-15 11:15:18 +01:00 committed by GitHub
parent 98dabc50c6
commit 5346e70ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -959,7 +959,7 @@ export class ElementHandle<
const layoutMetrics = await this._client.send('Page.getLayoutMetrics');
// Fallback to `layoutViewport` in case of using Firefox.
const { pageX, pageY } =
layoutMetrics.cssLayoutViewport || layoutMetrics.layoutViewport;
layoutMetrics.cssVisualViewport || layoutMetrics.layoutViewport;
const clip = Object.assign({}, boundingBox);
clip.x += pageX;