diff --git a/types/types.d.ts b/types/types.d.ts index 23dfe075a63f6..61c9dc5f7205d 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -380,11 +380,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */ @@ -554,11 +554,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */ @@ -728,11 +728,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */ @@ -902,11 +902,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */ @@ -1076,11 +1076,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */ @@ -2937,11 +2937,11 @@ export interface Page { * An example of handling `console` event: * * ```js - * page.on('console', msg => { + * page.on('console', async msg => { * for (let i = 0; i < msg.args().length; ++i) * console.log(`${i}: ${await msg.args()[i].jsonValue()}`); * }); - * page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); + * await page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); * ``` * */