MicrosoftEdge / MicrosoftEdge/WebView2Samples

navigator.mediaDevices is undefined

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1k
Forks
521
Avg merge
13m
Merged PRs (30d)
1

Description

Steps to reproduce

static TCHAR htmlProgram[] = 
L"<!doctype html>"
L"<html>"
L"    <body>"
L"        <script>alert(navigator.mediaDevices);</script>"
L"    </body>"
L"</html>";

// ...

webviewWindow->NavigateToString(htmlProgram);

Expected behavior

An alert box saying [object MediaDevices], which is what Microsoft Edge Canary gives.

Actual behavior

An alert box saying undefined.

Notes

I can't find any API to enable this functionality. Where is it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the inline htmlProgram repro and the webviewWindow->NavigateToString(htmlProgram) entry point, running it in the WebView2 sample and comparing the result with Edge Canary. Trace the available WebView2 media-device support and related configuration APIs. Done means navigator.mediaDevices is exposed or the issue clearly documents the unsupported behavior and required API.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.