Registers a handler to be called whenever the specified event occurs.
Parameter | Type | Default | Description |
---|---|---|---|
event | string | '' | Event to attach the handler to. Currently, only the 'console' event is supported. |
handler | function | null | A function to be called every time the specified event is emitted. |
attentionWhen using the page.on method, the page has to be explicitly closed for the iteration to be able to finish.
Events
Event | Description |
---|---|
console | Emitted every time the console API methods are called from within the page JavaScript context. The arguments passed into the handler are defined by the ConsoleMessage class. |