Skip to content

[BUG] Let sites list and pick cameras and microphones after Allow - #21

Merged
ignaciojuarez merged 1 commit into
mainfrom
fix/media-permission-state
Nov 10, 2026
Merged

ignaciojuarez merged 1 commit into
mainfrom
fix/media-permission-state

Conversation

@ignaciojuarez

Copy link
Copy Markdown
Owner

Problem

After Cobble allowed camera or microphone, Chromium kept no record of the decision. Pages then saw:

  • permissions.query({name: "camera"}) → prompt
  • enumerateDevices() → unnamed devices with empty IDs

Meeting sites (Zoom, Meet, Teams) read both to choose a device, so they reported no camera or microphone. A new harness check reproduces this on the beta 14 runtime (93c1dad): after Allow, the page reported prompt prompt false false.

Fix

  • Patch 0040: MediaStreamDevicePermissionContext asks an embedder resolver first, as window management already does. The host's permissionResolver now answers camera and microphone with the top-level origin, so saved allow/deny hold for quiet checks, permissions.query and device details.
  • One-time grant: an allowed camera or microphone request leaves a one-time grant for the top-level origin, like Chrome's "Allow this time". Every getUserMedia call still asks the host.
  • Reset: CCSContextResetPermission / ChromiumContext.resetPermission accept .camera and .microphone.
  • The C interface is unchanged, so this stays ABI 19.

Validation

  • Incremental native build of the packaged development runtime.
  • Isolated harness: 256/256 native checks, including five new ones: devices exposed after Allow, picking a device by ID, reset hides them, saved allow/deny answer quietly, and reset rejects bad kinds. Navigation, DOM, forms, rendering, WebGL2, downloads, clean shutdown and empty History tables also pass.
  • python3 -m unittest (73), node Tests/test_smoke_fixture.mjs, swift test (34) and swift build --product CobbleChromiumClient pass.

Not qualified

Fake devices skip macOS camera/microphone permission (TCC). Real hardware, a Developer ID release and real meeting sites still need manual checks. release_ready: false.

🤖 Generated with Claude Code

After the host allowed camera or microphone, Chromium kept no record of it:
permissions.query reported "prompt" and enumerateDevices returned unnamed
devices with empty IDs, so meeting sites such as Zoom and Meet reported no
camera or microphone.

- The host's permission resolver now also answers camera and microphone
  status checks (patch 0040), so saved decisions hold for quiet checks,
  permissions.query and device details.
- An allowed request leaves a one-time grant for the top-level origin, like
  Chrome's "Allow this time".
- CCSContextResetPermission and ChromiumContext.resetPermission clear camera
  and microphone grants too.
- Five new harness checks cover device details after Allow, picking a device
  by ID, reset, and saved allow/deny. The beta 14 runtime fails the first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ignaciojuarez
ignaciojuarez merged commit 98ec4ee into main Nov 10, 2026
1 of 2 checks passed
ignaciojuarez added a commit that referenced this pull request Nov 10, 2026
The camera/microphone device checks (#21) grew the harness's single async
validation function past what the macOS CI runner can compile: the Swift
frontend was killed (signal 9) and main's native-client check is red.

Move three self-contained sections out of `run` without changing them:
media/display/window-management requests, prompts/file choosers, and the
new device checks (HarnessMediaDeviceValidation.swift). A clean local
build's peak frontend memory drops from 26.6 GB to 15.9 GB, and build
time from 156 s to 52 s.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant