puppeteer/docs/api/puppeteer.page.waitfordeviceprompt.md
dependabot[bot] 93e9acc410
chore(deps-dev): Bump the dev-dependencies group with 3 updates (#12101)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <nvitkov@chromium.org>
2024-03-20 15:03:14 +00:00

1.0 KiB

sidebar_label
Page.waitForDevicePrompt

Page.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 Page {
  abstract waitForDevicePrompt(
    options?: WaitTimeoutOptions
  ): Promise<DeviceRequestPrompt>;
}

Parameters

Parameter

Type

Description

options

WaitTimeoutOptions

(Optional)

**Returns:**

Promise<DeviceRequestPrompt>

Example

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