Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
silviu22 opened this issue Feb 14, 2025 · 1 comment
Open

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

silviu22 opened this issue Feb 14, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@silviu22
Copy link

silviu22 commented Feb 14, 2025

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

@silviu22 silviu22 added the bug Something isn't working label Feb 14, 2025
@silviu22
Copy link
Author

Note that the NavigationCompleted event is received if I remove the css file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants