Skip to main content
Version: 21.2.1

Frame.waitForDevicePrompt() method

This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth.

caution

This must be called before the device request is made. It will not return a currently active device prompt.

Signature:

class Frame {
waitForDevicePrompt(
options?: WaitTimeoutOptions
): Promise<DeviceRequestPrompt>;
}

Parameters

ParameterTypeDescription
optionsWaitTimeoutOptions(Optional)

Returns:

Promise<DeviceRequestPrompt>

Example

const [devicePrompt] = Promise.all([
frame.waitForDevicePrompt(),
frame.click('#connect-bluetooth'),
]);
await devicePrompt.select(
await devicePrompt.waitForDevice(({name}) => name.includes('My Device'))
);