MicrosoftEdge / MicrosoftEdge/WebView2Feedback
2 seconds delay is seen with Page navigation using WebView2 & SetVirtualHostNameToFolderMapping
@dhveerap is already working on this.
Since Jun 16, 2025.
- 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
- Create a sample WPF Application
- Create WebView2 instance and add it to a WPF grid.
- Set CoreWebView2.SetVirtualHostNameToFolderMapping to a virtual host name and folder consisting of sample HTML page.
- Register NavigationStarting and NavigationCompleted events and log the timestamps.
- Load the sample HTML Page inside the WebView.
- 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.