Browser: support device APIs#322800
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds integrated-browser support for device-related permission flows (USB/Serial/HID/Bluetooth) by introducing a unified “Devices” permission category, wiring Electron device chooser events through the existing permission request pipeline, and surfacing selection UI in the workbench.
Changes:
- Introduces
PermissionCategory.Devicesplus shared device request payload types (BrowserDeviceType,IBrowserDeviceCandidate). - Implements main-process device chooser handling (USB/Serial/HID via session events, Bluetooth via
select-bluetooth-device) and a newselectDevice(...)API to return the user’s selection/cancellation. - Adds a workbench Quick Pick device chooser UI and extends unit tests for permission/category mapping defaults.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/browserView/electron-browser/features/browserPermissionsFeature.ts | Adds a Quick Pick-based device chooser UI and routes device requests vs. standard permission prompts. |
| src/vs/workbench/contrib/browserView/common/browserView.ts | Extends IBrowserViewModel with selectDevice(...) and forwards to the platform service. |
| src/vs/platform/browserView/test/common/browserPermissions.test.ts | Adds coverage for Devices default state and permission-string-to-category mappings (usb/serial/hid). |
| src/vs/platform/browserView/electron-main/browserViewMainService.ts | Exposes selectDevice(...) on the main-process browser view service. |
| src/vs/platform/browserView/electron-main/browserView.ts | Hooks Bluetooth device selection into session permissions and forwards device requests to the workbench event stream. |
| src/vs/platform/browserView/electron-main/browserSessionPermissions.ts | Implements unified device-request lifecycle, hot-plug updates, and request resolution by requestId. |
| src/vs/platform/browserView/common/browserView.ts | Adds IBrowserViewDeviceRequest and optional device payload on permission request events; adds selectDevice(...) to service API. |
| src/vs/platform/browserView/common/browserPermissions.ts | Adds the Devices permission category plus cross-IPC device candidate/type types and category descriptor metadata. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 4
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jrualesMatched files:
|
jruales
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#299521