How to set cookies to WebView2 control in c#?

  • Thread starter Thread starter Remya Paul Mechery
  • Start date Start date
R

Remya Paul Mechery

Guest
How to set the cookies in Webview2 control in c#?

Here is how i am navigating the url into WebView2 control.
WebView.CoreWebView2.Navigate("URL Name");


I tried using the 'WebResourceRequested' event but there is no way to add headers into the request.
WebView.CoreWebView2.WebResourceRequested += CoreWebView2_WebResourceRequested;
private void WebView_NavigationStarting(object sender, CoreWebView2NavigationStartingEventArgs e)
{
strNavigationURL = e.Uri;
e.RequestHeaders.????
}


Since I have read that in some other forum that this is a known bug of WebView2, and hopefully all waiting to see that is been resolved in WebView2 SDK 1.0.674-prerelease.

But i could not find any solution in WebView2 1.0.674 -Prerelease. Can someone help me in this regard?

Since i need to pass the authorization token to this URL, Can someone help me to add the header value to the request?

Continue reading...
 
Back
Top