WebView2Browser icon indicating copy to clipboard operation
WebView2Browser copied to clipboard

Save / Update Password prompts do not work

Open zattu1 opened this issue 4 years ago • 0 comments

I want to use Save / Update Password prompts, but it doesn't take effect even if I put the following process. Is there anything else I need to do?

HRESULT BrowserWindow::CreateBrowserControlsWebView()
{
    return m_uiEnv->CreateCoreWebView2Controller(m_hWnd, Callback<ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>(
        [this](HRESULT result, ICoreWebView2Controller* host) -> HRESULT
    {
        if (!SUCCEEDED(result))
        {
            OutputDebugString(L"Controls WebView creation failed\n");
            return result;
        }
        // WebView created
        m_controlsController = host;
        CheckFailure(m_controlsController->get_CoreWebView2(&m_controlsWebView), L"");

        wil::com_ptr<ICoreWebView2Settings> settings;
        RETURN_IF_FAILED(m_controlsWebView->get_Settings(&settings));
        RETURN_IF_FAILED(settings->put_AreDevToolsEnabled(FALSE));

        wil::com_ptr<ICoreWebView2Settings4> settings4;
        RETURN_IF_FAILED(m_controlsWebView->get_Settings(&settings));
        settings4 = settings.try_query<ICoreWebView2Settings4>();
        settings4->put_IsPasswordAutosaveEnabled(TRUE);

       ....
}

zattu1 avatar Aug 04 '21 01:08 zattu1