[Webkit-unassigned] [Bug 259465] New: No permission prompt for getUserMedia

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 24 19:14:09 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=259465

            Bug ID: 259465
           Summary: No permission prompt for getUserMedia
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Mac (Intel)
                OS: macOS 12
            Status: NEW
          Severity: Critical
          Priority: P2
         Component: Media
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: k4gcybex at gmail.com

Created attachment 467108

  --> https://bugs.webkit.org/attachment.cgi?id=467108&action=review

MCVe WKWebView implementation

Foreword: I've reviewed almost every issue in the webkit relating to prompts and getUserMedia, most are seemingly irrelevant with dead threads claiming 'fixed' but this issue persists.

Platform: 
- MacOS 12.6.8, 
- Safari 16.6

This is a typical usage of `getUserMedia` (for permissions only)
```
navigator.mediaDevices.getUserMedia({audio: true})
    .then((e) => alert("Permissions granted"))
    .catch((e) => alert("Permissions Denied"))
```

Adding this to an html <script/> tag, evaluating it during runtime as a function or calling it in web inspector console all provide the same results:

- On websites like google.com, bing.com, etc the above succeeds as expected: shows prompt and grants mic/camera access with indicator in status bar, etc.

- When accessing site via WKWebView (in iOS or macOS Swift application), this repeatably and consistently fails. However, asking for native microphone permissions succeeds (i.e. via AVCaptureDevice).

By failing (calling the following in `WKWebView`):

- `navigator.mediaDevices` is present
- `navigator.mediaDevices.enumerateDevices()` resolves with a single MediaDeviceInfo object: `[{deviceId: "", kind: "audioinput", label: "", groupId: ""}]`
- `navigator.mediaDevices.getUserMedia({audio: true, video: true})` promise never resolves but remains pending forever.

See more information here with full write-up (https://developer.apple.com/forums/thread/734363)

Find attached a MVCe Webkit (WKWebView) sample application to demonstrate this (bug?)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230725/3f45bc48/attachment.htm>


More information about the webkit-unassigned mailing list