Results 1 to 3 of 3

Thread: Pass Login details from main website to popup window automatically using WebView2

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2020
    Posts
    25

    Pass Login details from main website to popup window automatically using WebView2

    The following link shows how to pass login details to new window using Webbrowser control

    https://stackoverflow.com/questions/...ndow-i-created

    Is there a way to implement this functionality in WebView2?

    I have tried the option of navigating popup url to 2nd webview2 control with e.handled = true combination but this code is not working when 2nd website navigated from popup window takes login details from main website automatically(which cannot be passed while navigating through code)

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,368

    Re: Pass Login details from main website to popup window automatically using WebView2

    the link you posted refers to making popups MDIchilds of the application. your thread title says pass login details to popup. so not the same thing.

    you usually pass logon details with a cookiecontainer. it appears this is how it's done with webview2: https://github.com/MicrosoftEdge/Web...ack/issues/644

    I resolved it by avoiding the conversion: I hold onto a list of CoreWebView2Cookie instances captured from (A) and then set them into the second instance of the WebView2 control (B) using CoreWebView2.CookieManager.AddOrUpdateCookie() in the handler for the CoreWebView2InitializationCompleted event (in B).

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2020
    Posts
    25

    Re: Pass Login details from main website to popup window automatically using WebView2

    e.NewWindow = WebViewpop.CoreWebView2 under NewWindowRequested event solved my issue. It passes all the required details automatically.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width