Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a web page that opens a device chooser—such as a WebBluetooth request—use Puppeteer’s page.waitForDevicePrompt(). Start waiting before clicking the page control that triggers the request, find the intended device in the returned prompt, then select it. This is separate from mobile-device emulation and HTTP request interception.

Handle a page-triggered device prompt

The device-prompt flow applies when a page asks the browser to let a user choose a device. Puppeteer exposes that chooser as a DeviceRequestPrompt. The critical ordering is to begin waiting before the page triggers the request; the method does not return a prompt that is already active. See the Puppeteer Page.waitForDevicePrompt() reference.

Use the wait and triggering action together

In this example, the page has a button with the selector #connect-bluetooth. Replace the selector and name condition with those used by your test page and device setup.

const [devicePrompt] = await Promise.all([
  page.waitForDevicePrompt(),
  page.click('#connect-bluetooth'),
]);

const device = await devicePrompt.waitForDevice(
  ({ name }) => name.includes('My Device'),
);

await devicePrompt.select(device);

Starting both operations through Promise.all ensures the wait is in place as the click triggers the request. waitForDevice() resolves with a prompt device matching the predicate; select() chooses that device. Use a condition appropriate to your test environment. A device name is not necessarily unique, so make the predicate as discriminating as your available device information allows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the test environment eligible to show the prompt

The example assumes the page can make its device request in the browser environment where Puppeteer is running. The official API describes the prompt in connection with a page action that triggers a device request, for example through WebBluetooth. The device-selection prompt API does not itself create a peripheral or make an otherwise unavailable device appear.

Diagnose common device-prompt failures

  • The wait never resolves: Confirm the page action actually triggers the device request, and start waitForDevicePrompt() before that action. Calling it after the click can miss an already active prompt.
  • No device matches: Check the predicate against the device details available in the prompt and the devices exposed in your test environment. Avoid assuming that a particular product name is universal.
  • The page is waiting, but no chooser appears: Check that the page’s device-request path can run in the browser context you are automating. The prompt API handles a request initiated by the page; it is not a substitute for a real or otherwise available test device.
  • The method is unavailable in your installed package: The device-prompt reference is in Puppeteer’s Next documentation. Check the API reference and your project’s installed Puppeteer version before relying on it; the Next reference alone does not establish availability in every release.

Choose the Puppeteer API for the event you mean

“Device request” can refer to different automation tasks. Pick the API based on what the page or browser is doing:

Task Puppeteer API or object When to set it up
Respond to a page-triggered device chooser page.waitForDevicePrompt() returns a DeviceRequestPrompt Begin waiting before the page action that triggers the request
Emulate a mobile device profile page.emulate(device), or user-agent and viewport APIs Apply emulation before navigation
Intercept or modify network requests page.setRequestInterception(true) and HTTPRequest resolution methods Enable interception before handling the requests you intend to change

Mobile-device emulation is not a physical device chooser

page.emulate(device) applies a device profile’s user-agent and viewport metrics; the API reference describes it as a shortcut for setting those values. It does not select a Bluetooth peripheral or turn the browser into a physical phone. Apply the profile before navigation because changing viewport dimensions resizes the page and may trigger a reload in some cases. See the Page.emulate() reference and Puppeteer device profiles.

HTTP request interception handles network traffic

page.setRequestInterception(true) concerns page network requests, not browser device-selection prompts. When interception is enabled, requests stall until continued, aborted, or fulfilled, except requests completed using the browser cache. Ensure each intercepted request is resolved. If multiple handlers may resolve a request, guard against requests already handled; Puppeteer’s cooperative priority mode applies only when all resolutions use priorities, while a legacy resolution can resolve immediately. Consult the network interception guide and Page.setRequestInterception() reference.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo takes website screenshots through one API request; it is not a Puppeteer device-prompt handler and does not select a Bluetooth device. For screenshot work, the following cURL request saves a WebP capture:

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Before capture, ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.