docs(api.md): fix snippet to await page.setViewport() (#2113)
This commit is contained in:
parent
ffe5b63dba
commit
c857aef589
@ -1337,7 +1337,7 @@ const puppeteer = require('puppeteer');
|
|||||||
puppeteer.launch().then(async browser => {
|
puppeteer.launch().then(async browser => {
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
const watchDog = page.waitForFunction('window.innerWidth < 100');
|
const watchDog = page.waitForFunction('window.innerWidth < 100');
|
||||||
page.setViewport({width: 50, height: 50});
|
await page.setViewport({width: 50, height: 50});
|
||||||
await watchDog;
|
await watchDog;
|
||||||
await browser.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user