DeviceRequestPrompt 类
设备请求提示让你可以响应页面通过 WebBluetooth 等 API 发起的设备请求。
签名
export declare abstract class DeviceRequestPrompt
备注
DeviceRequestPrompt 实例通过 Page.waitForDevicePrompt() 方法返回。
示例
const [devicePrompt] = Promise.all([
page.waitForDevicePrompt(),
page.click('#connect-bluetooth'),
]);
await devicePrompt.select(
await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
);
属性
|
属性 |
修饰符 |
类型 |
说明 |
|---|---|---|---|
|
devices |
|
当前可选择的设备列表。 |
方法
|
方法 |
修饰符 |
说明 |
|---|---|---|
|
取消该提示。 | ||
|
在提示的列表中选择一个设备。 | ||
|
解析为提示中第一个匹配过滤器的设备。 |