MicrosoftEdge / MicrosoftEdge/WebView2Feedback

2 seconds delay is seen with Page navigation using WebView2 & SetVirtualHostNameToFolderMapping

Open
#2,381 16 comments 3 reactions 2 assignees View on GitHub

@dhveerap is already working on this.

Since Jun 16, 2025.

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

Description

Description
When we load a local page using SetVirtualHostNameToFolderMapping and the domain is non-existent we see a 2 secondsdelay in the page navigation to complete.

Version
SDK: 1.0.1185.39
Runtime: 100.0.1185.44
Framework: WPF
OS: Win10

Repro Steps

  1. Create a sample WPF Application
  2. Create WebView2 instance and add it to a WPF grid.
  3. Set CoreWebView2.SetVirtualHostNameToFolderMapping to a virtual host name and folder consisting of sample HTML page.
  4. Register NavigationStarting and NavigationCompleted events and log the timestamps.
  5. Load the sample HTML Page inside the WebView.
  6. Run the application.

Note that the page loads after 2 seconds delay. That can be seen by taking the difference in timestamps logged in NavigationCompleted and NavigationStarting events.

Workaround
If we add a host file entry mapping valid IP address (machine's IP) and virtual hostname (provided in SetVirtualHostNameToFolderMapping), the page loads fine without any delay.

Additional context
It looks like it is trying to reach the host and causes the timeout.

AB#39415297

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.