-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I adapt this code to use put_ChannelSearchKind instead of a folder when initialising with Win32? #5055
Comments
I have downloaded the latest samples and done a full search for how to use this property. It is not used in any code. |
OK, I think the docs might be out of date? This is exposed in my IDE:
But again, how do we safely remove the use of |
Doesn't make sense to me. I adjusted my code to set the search code and I passed null for the folder argument: void CWebBrowser::InitializeWebView()
{
CloseWebView();
CString subFolder = GetInstallPath();
CString appData = GetUserDataFolder();
auto options = Microsoft::WRL::Make<CoreWebView2EnvironmentOptions>();
CHECK_FAILURE(options->put_AdditionalBrowserArguments(L"--allow-file-access-from-files"));
CHECK_FAILURE(options->put_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE));
//CHECK_FAILURE(options->put_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND_LEAST_STABLE));
HRESULT hr = CreateCoreWebView2EnvironmentWithOptions(
nullptr,
appData,
options.Get(),
Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
this,
&CWebBrowser::OnCreateEnvironmentCompleted).Get());
if (!SUCCEEDED(hr))
{
CString text;
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
text = L"Cannot found the WebView2 component.";
}
else
{
text = L"Cannot create the webview environment.";
}
ShowFailure(hr, text);
}
} In my tests:
No matter what I try, it still seems to use my stable runtime and not the Canary Edge ... |
Besides, when I do try to use the experimental features I get a popup saying the browser I am using does not support them. |
Originally posted by @pushkin- in #1737
I would like to adapt my code to use this concept. At the moment I have:
I am not sure how to tweak this to use the
put_ChannelSearchKind
(COREWEBVIEW2_CHANNEL_SEARCH_KIND value) property instead of the folder.I want to temporarily set it to
COREWEBVIEW2_CHANNEL_SEARCH_KIND_LEAST_STABLE
.The text was updated successfully, but these errors were encountered: