MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Feature]: Cancel Navigation asynchronously
@Lakshmisha-KS is already working on this.
Since Jul 2, 2025.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.