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.