Search code examples
javascriptc#visual-studiowebview2

WebView2: How to enable Password Autofill?


How can I change the "IsPasswordAutofillEnabled" Property to be "TRUE" on WebView2?

I've read the Microsoft page countless of times but can't actually figure out how to do it in Visual Studio.


Solution

  • This feature is an experimental feature of Microsoft.Web.WebView2 package 1.0.865-prerelease and only exists in this version.

    If you want to use it, just add the following package references in the package reference interface:

    <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.865-prerelease" />
    

    enter image description here

    Modify the attribute like this:

    webView.CoreWebView2.Settings.IsPasswordAutofillEnabled = true;(webView is the control's name)
    

    Here is the introduction document of webview2.