Skip to content

Add in-dialog camera permission request option to payment handler - #14

Merged
stephenmcgruer merged 3 commits into
GoogleChromeLabs:mainfrom
luis-antunes:dialog-camera-access
Aug 12, 2026
Merged

Add in-dialog camera permission request option to payment handler#14
stephenmcgruer merged 3 commits into
GoogleChromeLabs:mainfrom
luis-antunes:dialog-camera-access

Conversation

@luis-antunes

Copy link
Copy Markdown
Contributor

Currently, the camera test page (camera_test.html) provides two options when camera access is tested:

  1. "Start Camera": invokes getUserMedia and renders video to a
  2. "Grant Camera Access in Popup Window": opens a separate popup window to trigger the permission prompt externally (previously required when payment handler dialogs did not support native permission prompts).

To test native permission handling directly inside the payment handler dialog, this change adds a "Grant Camera Access inside this Dialog" link.

When clicked, it calls navigator.mediaDevices.getUserMedia() directly within the dialog, stops all tracks immediately upon granting, and updates the permission status UI. The link is visible when camera permission is in 'prompt' or 'denied' state, matching the popup link.

luis-antunes and others added 3 commits August 11, 2026 18:02
Currently, the camera test page (camera_test.html) provides two options
when camera access is tested:
1. "Start Camera": invokes getUserMedia and renders video to a <video> element.
2. "Grant Camera Access in Popup Window": opens a separate popup window
   to trigger the permission prompt externally (previously required when
   payment handler dialogs did not support native permission prompts).

To test native permission handling directly inside the payment handler
dialog, this change adds a "Grant Camera Access inside this Dialog" link.

When clicked, it calls navigator.mediaDevices.getUserMedia() directly
within the dialog, stops all tracks immediately upon granting, and
updates the permission status UI. The link is visible when camera
permission is in 'prompt' or 'denied' state, matching the popup link.
@stephenmcgruer
stephenmcgruer merged commit b624967 into GoogleChromeLabs:main Aug 12, 2026
6 checks passed
@luis-antunes
luis-antunes deleted the dialog-camera-access branch August 12, 2026 15:51
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.

2 participants