Back to Puppeteer

DeviceRequestPrompt.waitForDevice() method

docs/api/puppeteer.devicerequestprompt.waitfordevice.md

19.2.2835 B
Original Source

DeviceRequestPrompt.waitForDevice() method

Resolve to the first device in the prompt matching a filter.

Signature

typescript
class DeviceRequestPrompt {
  abstract waitForDevice(
    filter: (device: DeviceRequestPromptDevice) => boolean,
    options?: WaitTimeoutOptions,
  ): Promise<DeviceRequestPromptDevice>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

filter

</td><td>

(device: DeviceRequestPromptDevice) => boolean

</td><td> </td></tr> <tr><td>

options

</td><td>

WaitTimeoutOptions

</td><td>

(Optional)

</td></tr> </tbody></table>

Returns:

Promise<DeviceRequestPromptDevice>