ICoreWebView2NavigationStartingEventArgs - Need access to POST data
Problem description. There is no way to get the content of a form submission in the NavigationStarting event. It was available in the "OnBeforeNavigate2" with IE embedded browser.
Solution ? It would be good to add such capability to ICoreWebView2NavigationStartingEventArgs
Hey @niclet - thanks for the feature request! I've added it to our backlog. We currently do expose POST data in the WebResourceRequested event - would that event work for you?
@champnic Thanks for your feedback Actually, we use form submit with custom url scheme and POST data. Depending on this url AND its data, we take some actions and may cancel the navigation. That's why we need to have access to the data in the NavigationStarting event itself.
@champnic , We do have similar requirement in our WPF application to cancel webpage navigation based on post data value.
in IE we can access postdata in below event. onBeforeNavigate2(object pDisp, ref object URL, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
Can you please let us know when this feature request will be implemented in webview2.
we also need to be able to cancel a request based on the contents of the request (POST) data. we need to be able to access the request data in the NavigationStarting event, or cancel the request in the WebResourceRequested event.
Hi @champnic , Is there any update on this feature request? when it will be added to webview2
Thanks
We are currently working on this feature now. No specific timeline, but will likely be available within the next few releases. Thanks!
@champnic , Is there any update on the release date for the fix?
thanks
@SureshkPerumal @niclet @kurash Maybe calling CoreWebView2.Stop in WebResourceRequested event or override WebResourceResponse there with code 204 can solve your problem? Anyway, we are adding a param in NavigationStartingEventArgs to get POST data. I'll notify you when it enters prerelease.
We do require this functionality too. Will this be ever available?
We do require this functionality too. Will this be ever available?
See https://github.com/MicrosoftEdge/WebView2Feedback/issues/2162