parent
bc6902623a
commit
2f1157b044
@ -428,8 +428,8 @@ The arguments passed into `console.log` appear as arguments on the event handler
|
|||||||
An example of handling `console` event:
|
An example of handling `console` event:
|
||||||
```js
|
```js
|
||||||
page.on('console', msg => {
|
page.on('console', msg => {
|
||||||
for (let i = 0; i < msg.args.length; ++i)
|
for (let i = 0; i < msg.args().length; ++i)
|
||||||
console.log(`${i}: ${msg.args[i]}`);
|
console.log(`${i}: ${msg.args()[i]}`);
|
||||||
});
|
});
|
||||||
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user