MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Feature]: Cancel Navigation asynchronously

Open
#5,287 4 comments 0 reactions 1 assignee View on GitHub

@Lakshmisha-KS is already working on this.

Since Jul 2, 2025.

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

Description

Describe the feature/enhancement you need

It would be nice to make it possible to cancel navigations (see ICoreWebView2NavigationStartingEventArgs) asynchronously.

WebKit already supports this, see e.g. https://webkitgtk.org/reference/webkitgtk/stable/signal.WebView.decide-policy.html

What I would like is a similar event, e.g. decide-policy in WebView2, or the possibility to cancel a NavigationStartingEvent at a later time

The scenario/use case where you would use this feature

Sometimes a slightly expensive lookup may have to be performed to check if a navigation request should be cancelled or not. It would be nice to have the possibility to do this asynchronously as to not block all of WebVIew2.

How important is this request to you?

Impactful. My app's user experience would be significantly compromised without it.

Suggested implementation

I think it would be enough to add a get_Deferral to ICoreWebView2NavigationStartingEventArgs which when invoked will wait for the deferral to be completed before starting the navigation.

What does your app do? Is there a pending deadline for this request?

General purpose WebView library, which could support asynchronous handling of events of this kind but currently cant, as WebView2 is the only backend where this would not be possible.

There is a pending release which could make great use of this.

AB#61586107

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.