App - puppeteerApp
Kind: global class
Event handling class, used to manage event listening, triggering, and removal.
App.addEventListener(event, listener)
Add an event listener, adding the listener function to the list of listeners for a specific event.
Kind: static method of App
Param | Type | Description |
---|---|---|
event | string | Event name |
listener | function | The function of the event listener to be added |
App.removeEventListener(event, listener)
Remove the event listener, remove the specified listener function from the listener list of a specific event. If no specific listener is provided, remove the entire listener list of the event.
Kind: static method of App
Param | Type | Description |
---|---|---|
event | string | Event name |
listener | function | The function of the event listener to be removed |
App.dispatchEvent(event, data)
Trigger a specific event, call all the listener functions corresponding to that event, and pass specific data.
Kind: static method of App
Param | Type | Description |
---|---|---|
event | string | The name of the event to be triggered |
data | any | The data to be passed to the listener function |
App.removeAllEventListeners()
Remove all event listeners, clear the listener object.
Kind: static method of App
AppEvent
new AppEvent()
Constructor, initialize an empty event listener object.