Class DeviceRequestPrompt
- Namespace
- PuppeteerSharp
- Assembly
- PuppeteerSharp.dll
Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth.
public class DeviceRequestPrompt
- Inheritance
-
DeviceRequestPrompt
Examples
Remarks
DeviceRequestPrompt instances are returned via the WaitForDevicePromptAsync(WaitForOptions).
Properties
Devices
Current list of selectable devices.
public List<DeviceRequestPromptDevice> Devices { get; }
Property Value
Methods
CancelAsync()
Cancel the prompt.
public Task CancelAsync()
Returns
- Task
A task that resolves after the cancel message is processed by the browser.
SelectAsync(DeviceRequestPromptDevice)
Select a device in the prompt's list.
public Task SelectAsync(DeviceRequestPromptDevice device)
Parameters
device
DeviceRequestPromptDeviceThe device to select.
Returns
- Task
A task that resolves after the select message is processed by the browser.
WaitForDeviceAsync(Func<DeviceRequestPromptDevice, bool>, WaitForOptions)
Resolve to the first device in the prompt matching a filter.
public Task<DeviceRequestPromptDevice> WaitForDeviceAsync(Func<DeviceRequestPromptDevice, bool> filter, WaitForOptions options = null)
Parameters
filter
Func<DeviceRequestPromptDevice, bool>The filter to apply.
options
WaitForOptionsThe options.
Returns
- Task<DeviceRequestPromptDevice>
A task that resolves to the first device matching the filter.