Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICoreWebView2NavigationStartingEventArgs - Need access to POST data #1202

Open
niclet opened this issue Apr 20, 2021 · 10 comments
Open

ICoreWebView2NavigationStartingEventArgs - Need access to POST data #1202

niclet opened this issue Apr 20, 2021 · 10 comments
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@niclet
Copy link

niclet commented Apr 20, 2021

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 niclet added the feature request feature request label Apr 20, 2021
@champnic champnic added the tracked We are tracking this work internally. label Apr 21, 2021
@champnic
Copy link
Member

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?

@niclet
Copy link
Author

niclet commented Apr 21, 2021

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

@SureshkPerumal
Copy link

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

@kurash
Copy link

kurash commented Dec 15, 2021

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.

@SureshkPerumal
Copy link

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

Thanks

@champnic
Copy link
Member

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

@SureshkPerumal
Copy link

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

thanks

@zhuhaichao518
Copy link
Contributor

zhuhaichao518 commented Nov 22, 2022

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

@alervd
Copy link

alervd commented Sep 14, 2024

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

@leonidukg
Copy link

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

See #2162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

7 participants