Files
browser-automation-botGitHubrelease-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4d7b677d1d chore: release main (#15201)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2026-07-27 14:29:23 +02:00

1.6 KiB

sidebar_label
sidebar_label
DeviceRequestPrompt

DeviceRequestPrompt class

Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.

Signature

export declare abstract class DeviceRequestPrompt

Remarks

DeviceRequestPrompt instances are returned via the Page.waitForDevicePrompt() method.

Example

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

Properties

Property

Modifiers

Type

Description

devices

readonly

DeviceRequestPromptDevice[]

Current list of selectable devices.

Methods

Method

Modifiers

Description

cancel()

Cancel the prompt.

select(device)

Select a device in the prompt's list.

waitForDevice(filter, options)

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