Skip to content

WebView2 reports navigation failure for URLs with non-Western characters despite successful page load #10339

@praveenkumarkarunanithi

Description

Describe the bug

When using WebView2 in a WinUI 3 application, the NavigationCompleted event reports a failure (IsSuccess = false) for URLs containing encoded non-Western characters, even though the webpage loads successfully. This inconsistency between the reported navigation status and the actual page load state can lead to incorrect error handling in applications relying on the NavigationCompleted event.

Steps to reproduce the bug

  1. Download and open the attached WinUI 3 sample project in Visual Studio 2022. winui3.zip
  2. Build and run the application.
  3. Observe that the WebView2 control loads and displays the webpage correctly.
  4. Check the Output window in Visual Studio (View -> Output or Ctrl+Alt+O) and select "Debug" in the dropdown.
  5. Note that the debug statement logs "Navigation failed with error: Unknown" due to IsSuccess being false in the NavigationCompleted event, even though the webpage loads properly.

Expected behavior

The NavigationCompleted event should have IsSuccess as true since the webpage loads correctly in WebView2.

Screenshots

Image

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (23H2): Build 22631

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions