Home > assistive-playwright-client > ScreenReaderClient > once
Registers a one-time listener for the message event, that will be called the next time a message is received from the screen reader.
Signature:
once(event: "message", listener: (message: string) => void): this;
| Parameter | Type | Description |
|---|---|---|
| event | “message” | “message” |
| listener | (message: string) => void | function to be called with the received messageThe listener can removed with ScreenReaderClient.off(). |
Returns:
this