mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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;
|
||||
|
||||
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.
|
||||
clip = undefined;
|
||||
|
||||
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 {
|
||||
isMobile = false,
|
||||
deviceScaleFactor = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user