mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge pull request #28266 from tobold/master
[puppeteer] add option defaultViewport to launchOptions interface to adhere to official docs
This commit is contained in:
Vendored
+29
@@ -1647,6 +1647,35 @@ export interface LaunchOptions {
|
||||
* Useful so that you can see what is going on.
|
||||
*/
|
||||
slowMo?: number;
|
||||
/**
|
||||
* Sets a consistent viewport for each page. Defaults to an 800x600 viewport. null disables the default viewport.
|
||||
*/
|
||||
defaultViewport?: {
|
||||
/**
|
||||
* page width in pixels.
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* page height in pixels.
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Specify device scale factor (can be thought of as dpr). Defaults to 1.
|
||||
*/
|
||||
deviceScaleFactor?: number;
|
||||
/**
|
||||
* Whether the meta viewport tag is taken into account. Defaults to false.
|
||||
*/
|
||||
isMobile?: boolean;
|
||||
/**
|
||||
* Specifies if viewport supports touch events. Defaults to false.
|
||||
*/
|
||||
hasTouch?: boolean;
|
||||
/**
|
||||
* Specifies if viewport is in landscape mode. Defaults to false.
|
||||
*/
|
||||
isLandscape?: boolean;
|
||||
};
|
||||
/**
|
||||
* Additional arguments to pass to the Chromium instance. List of Chromium
|
||||
* flags can be found here.
|
||||
|
||||
@@ -167,6 +167,7 @@ puppeteer.launch().then(async browser => {
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
],
|
||||
defaultViewport: { width: 800, height: 600 },
|
||||
handleSIGINT: true,
|
||||
handleSIGHUP: true,
|
||||
handleSIGTERM: true,
|
||||
|
||||
Reference in New Issue
Block a user