MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: WebView2 does not support blocking main thread using javascript async/await

Open
#4,893 4 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?

As the showModal API has been deprecated in modern browsers - https://developer.mozilla.org/en-US/docs/Web/API/Window/showModalDialog, I am trying to achieve a similar functionality using the polyfill mentioned in the MDN page :https://github.com/niutech/showModalDialog/blob/gh-pages/showModalDialog.js.

The above mentioned polyfill works fine with edge/chrome browser but it does not work with WebView2 application. When the modal pops up, it freezes the entire application. The WebView2 application is used to launch a web application in embedded and all the code changes mentioned here are on javascript side.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

Win32

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

Use the showModal dialog polyfill and re-implement the API using async-await in javascript, and invoke the modal in middle of the code flow.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

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 linked showModalDialog polyfill and the reported async/await repro in a Win32 WebView2 app on Windows 10 or 11. Compare the behavior with the corresponding Edge version, using the stable WebView2 Runtime. Done means establishing whether this blocking behavior is supported, reproducible, or requires a documented workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
desktop, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.