Skip to content

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

ParamTypeDescription
eventstringEvent name
listenerfunctionThe 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

ParamTypeDescription
eventstringEvent name
listenerfunctionThe 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

ParamTypeDescription
eventstringThe name of the event to be triggered
dataanyThe data to be passed to the listener function

App.removeAllEventListeners()

Remove all event listeners, clear the listener object.

Kind: static method of App

AppEvent

Kind: global class

new AppEvent()

Constructor, initialize an empty event listener object.