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;
|
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