WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

ICoreWebView2NavigationStartingEventArgs - Need access to POST data

Open niclet opened this issue 4 years ago • 10 comments

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

AB#32707601

niclet avatar Apr 20 '21 09:04 niclet

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 avatar Apr 21 '21 05:04 champnic

@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.

niclet avatar Apr 21 '21 06:04 niclet

@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.

SureshkPerumal avatar Nov 29 '21 09:11 SureshkPerumal

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.

kurash avatar Dec 15 '21 13:12 kurash

Hi @champnic , Is there any update on this feature request? when it will be added to webview2

Thanks

SureshkPerumal avatar Mar 18 '22 09:03 SureshkPerumal

We are currently working on this feature now. No specific timeline, but will likely be available within the next few releases. Thanks!

champnic avatar Mar 18 '22 21:03 champnic

@champnic , Is there any update on the release date for the fix?

thanks

SureshkPerumal avatar Apr 18 '22 19:04 SureshkPerumal

@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.

zhuhaichao518 avatar Nov 22 '22 03:11 zhuhaichao518

We do require this functionality too. Will this be ever available?

alervd avatar Sep 14 '24 07:09 alervd

We do require this functionality too. Will this be ever available?

See https://github.com/MicrosoftEdge/WebView2Feedback/issues/2162

leonidukg avatar Sep 14 '24 19:09 leonidukg