From 53ddbc865809cedd7e91bf173df78fe44735a7f2 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Wed, 5 Dec 2018 00:47:46 +0200 Subject: [PATCH] puppeteer: allow disabling default viewport null disables the default viewport (verified locally). comment already mentions that, but it wasn't accepted in the type. --- types/puppeteer/index.d.ts | 2 +- types/puppeteer/puppeteer-tests.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index ff05cc4de0..2051603f69 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -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. diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index b708f1bc0c..1f587d470e 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -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({