MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Crash on "Page.fileChooserOpened" event callback

Open
#2,733 2 comments 0 reactions 1 assignee View on GitHub

@LiangTheDev is already working on this.

Since Sep 2, 2022.

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

Description

Description

await WebView2.CoreWebView2.CallDevToolsProtocolMethodAsync("Page.enable", "{}");
WebView2.CoreWebView2.GetDevToolsProtocolEventReceiver("Page.fileChooserOpened").DevToolsProtocolEventReceived += OnPageFileChooserOpened;
await WebView2.CoreWebView2.CallDevToolsProtocolMethodAsync("Page.setInterceptFileChooserDialog", "{\"enabled\": true}");

will either work, or do nothing or crash with an Access violation (write or read).
Seems to depend on how many objects were created until the callback is triggered within the WebView2

Version
SDK: AppSDK 1.1.3 & 1.1.4
Runtime: Dev 106.0.1356.0
Framework: WinUI3 Desktop
OS: Win11 22000.918

Repro Steps

  1. run project from https://github.com/minesworld/WindowsAppSDKBugs
  2. put into the text box an address where a file upload is possible, click "Go" button
  3. do the file upload, if the callback is triggered "OnPageFileChooserOpened" will be shown in debug output...

Expected behavior is that it will work every time.

Screenshots

Additional context
Filed a Bug under AppSDK too... https://github.com/microsoft/WindowsAppSDK/issues/2921

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.