puppeteer: allow disabling default viewport

null disables the default viewport (verified locally). comment already mentions that, but it wasn't accepted in the type.
This commit is contained in:
Avi Vahl
2018-12-05 00:47:46 +02:00
parent 30b692cad9
commit 53ddbc8658
2 changed files with 8 additions and 1 deletions

View File

@@ -2044,7 +2044,7 @@ export interface BrowserOptions {
* @default false
*/
isLandscape?: boolean;
};
} | null;
/**
* Slows down Puppeteer operations by the specified amount of milliseconds.
* Useful so that you can see what is going on.

View File

@@ -200,6 +200,13 @@ puppeteer.launch().then(async browser => {
browser.close();
})();
// Launching with default viewport disabled
(async () => {
await puppeteer.launch({
defaultViewport: null
});
})();
// Test v0.12 features
(async () => {
const browser = await puppeteer.launch({