docs(api.md): fix snippet to await page.setViewport() (#2113)

This commit is contained in:
Olivier Tassinari 2018-03-01 22:06:22 +01:00 committed by Andrey Lushnikov
parent ffe5b63dba
commit c857aef589

View File

@ -1337,7 +1337,7 @@ const puppeteer = require('puppeteer');
puppeteer.launch().then(async browser => {
const page = await browser.newPage();
const watchDog = page.waitForFunction('window.innerWidth < 100');
page.setViewport({width: 50, height: 50});
await page.setViewport({width: 50, height: 50});
await watchDog;
await browser.close();
});