MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: NavigationCompleted event is not received

Open
#5,105 1 comment 0 reactions 1 assignee View on GitHub

@dhveerap is already working on this.

Since Feb 18, 2025.

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

Description

What happened?

I am using WebView2 functionality to convert a HTM file to PDF. The sequence is something like this:

  1. call ICoreWebView2::add_NavigationCompleted
  2. call ICoreWebView2::Navigate
  3. wait for NavigationCompleted event
  4. call ICoreWebView2_16::PrintToPdfStream to get the output PDF file.

However, for some files, NavigationCompleted is never received. I found that this often happens with HTML files extracted from ePub files.

This is a major hassle, because my app hangs waiting forever for this event. I attached a file that can reproduce this.

I have added brought up the Devtools window by adding the "--auto-open-devtools-for-tabs" option to the command line using the ICoreWebView2EnvironmentOptions::put_AdditionalBrowserArguments method. It is interesting that as soon as I go to DevTools->Elements window, the NavigationCompleted event is received!

The sample file that can reproduce this is in epub.zip\epub.htm
epub.zip

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

133.0.3065.59

SDK Version

1.0.1661.34

Framework

Win32

Operating System

Windows 11

OS Version

22631.4751

Repro steps

See the steps in "What happened".

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.