chore: small refactor for screenshotTask (#9451)
This commit is contained in:
parent
86441e313d
commit
6bc152ece0
@ -1377,14 +1377,13 @@ export class CDPPage extends Page {
|
|||||||
const fromSurface = options.fromSurface;
|
const fromSurface = options.fromSurface;
|
||||||
|
|
||||||
if (options.fullPage) {
|
if (options.fullPage) {
|
||||||
const metrics = await this.#client.send('Page.getLayoutMetrics');
|
|
||||||
// Fallback to `contentSize` in case of using Firefox.
|
|
||||||
const {width, height} = metrics.cssContentSize || metrics.contentSize;
|
|
||||||
|
|
||||||
// Overwrite clip for full page.
|
// Overwrite clip for full page.
|
||||||
clip = undefined;
|
clip = undefined;
|
||||||
|
|
||||||
if (!captureBeyondViewport) {
|
if (!captureBeyondViewport) {
|
||||||
|
const metrics = await this.#client.send('Page.getLayoutMetrics');
|
||||||
|
// Fallback to `contentSize` in case of using Firefox.
|
||||||
|
const {width, height} = metrics.cssContentSize || metrics.contentSize;
|
||||||
const {
|
const {
|
||||||
isMobile = false,
|
isMobile = false,
|
||||||
deviceScaleFactor = 1,
|
deviceScaleFactor = 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user