interface ICoreWebView2ExperimentalProfile

Note

This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.

Note

This an experimental API that is shipped with our prerelease SDK. See WebView2 release notes.

interface ICoreWebView2ExperimentalProfile
  : public IUnknown

Profile for ICoreWebView2Experimental8 interface.

Summary

Members Descriptions
get_IsInPrivateModeEnabled InPrivate mode is enabled or not.
get_ProfileName Name of the profile.
get_ProfilePath Full path of the profile directory.
        auto webview2Experimental8 = coreWebView2.try_query<ICoreWebView2Experimental8>();
        if (webview2Experimental8)
        {
            wil::com_ptr<ICoreWebView2ExperimentalProfile> profile;
            CHECK_FAILURE(webview2Experimental8->get_Profile(&profile));
            wil::unique_cotaskmem_string profile_path;
            CHECK_FAILURE(profile->get_ProfilePath(&profile_path));
            std::wstring str(profile_path.get());
            m_profileDirName = str.substr(str.find_last_of(L'\\') + 1);
            BOOL inPrivate = FALSE;
            CHECK_FAILURE(profile->get_IsInPrivateModeEnabled(&inPrivate));
            if (!m_webviewOption.downloadPath.empty())
            {
                auto webView2ExperimentalProfile3 =
                    profile.try_query<ICoreWebView2ExperimentalProfile3>();
                CHECK_FAILURE(webView2ExperimentalProfile3->
                    put_DefaultDownloadFolderPath(
                        m_webviewOption.downloadPath.c_str()));
            }

            // update window title with m_profileDirName
            UpdateAppTitle();

            // update window icon
            SetAppIcon(inPrivate);
        }

Applies to

Product Introduced
WebView2 Win32 N/A
WebView2 Win32 Prerelease 1.0.1018

Members

get_IsInPrivateModeEnabled

InPrivate mode is enabled or not.

public HRESULT get_IsInPrivateModeEnabled(BOOL * value)

get_ProfileName

Name of the profile.

public HRESULT get_ProfileName(LPWSTR * value)

get_ProfilePath

Full path of the profile directory.

public HRESULT get_ProfilePath(LPWSTR * value)