Skip to content

[Problem/Bug]: NavigationCompleted event is not received #5105

Open
@silviu22

Description

@silviu22

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions