MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Cannot suppress (Camera) permission prompt

Open
#5,285 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

Using WebView2, it appears like certain websites can prompt for permissions, like Camera permissions. I need to deny those permissions on behalf of the users - no permission prompt should be shown.
The CoreWebView2.PermissionRequested event handler is not called.

Image

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

1.0.2903.40

Framework

WinUI3/WinAppSDK

Operating System

Windows 11

OS Version

26100.4351

Repro steps
webView.CoreWebView2Initialized += (c, e) =>
{
    c.CoreWebView2.PermissionRequested += (sender, args) =>
    {
        args.Handled = true;
        args.State = CoreWebView2PermissionState.Deny;
    };
};
webView.Source = new Uri("https://webcamtests.com/");
Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

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 CoreWebView2Initialized and CoreWebView2.PermissionRequested handlers in the repro, then compare the behavior with the corresponding Edge version. Determine why the camera permission event is not raised and whether the requested denial behavior can be achieved; done means the cause and a verified resolution are documented or implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, security
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.