Skip to content

WebView2 browser is not able to load twitch , getting error Browser not supported #267

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

Open
valapran-flutterint opened this issue Feb 21, 2025 · 6 comments

Comments

@valapran-flutterint
Copy link

I am not able to login twitch using WebView2 embedded browser, I am getting this error Browser not supported

Able to login using Chrome/Edge. What changes needs to be made to make it work?

@valapran-flutterint
Copy link
Author

Image

@brucewedding
Copy link

Have you tried setting your User-Agent to Edge?
webView.CoreWebView2.Settings.UserAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.3124.93

@valapran-flutterint
Copy link
Author

I don't set any user agent, by default the user agent is
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0

@brucewedding
Copy link

I'm not sure what to tell you. It works fine for me doing this:
m_webview->Navigate(L"https://www.twitch.tv/");

using: .\packages\Microsoft.Web.WebView2.1.0.3065.39\build\native\include\WebView2.h

Image

@valapran-flutterint
Copy link
Author

valapran-flutterint commented Apr 3, 2025

Forgot to mention, I am capturing console log. And the page loads when when trying to login getting the above error

		CHECK_SUCCESS( view->CallDevToolsProtocolMethod( L"Runtime.enable", L"{}", nullptr ) );
		ICoreWebView2DevToolsProtocolEventReceiver* eventReceived = nullptr;
		if( CHECK_SUCCESS( view->GetDevToolsProtocolEventReceiver( L"Runtime.consoleAPICalled", &eventReceived ) ) )
		{
			if( eventReceived )
			{
				EventRegistrationToken token;
				auto res = eventReceived->add_DevToolsProtocolEventReceived(

@brucewedding
Copy link

brucewedding commented Apr 3, 2025

I forgot to try the login. Seems to work fine for me, though I don't have a twitch account and won't be creating one.

Image

Actually, I was curious enough to create one. Logged in fine:

Image

These are my settings:

    bool m_devToolsEnabled = true;
    bool m_defaultContextMenusEnabled = true;
    bool m_builtInErrorPageEnabled = false;
    bool m_statusBarEnabled = true;
    bool m_zoomControlEnabled = true;

           settings->put_AreHostObjectsAllowed(TRUE);
           settings->put_IsScriptEnabled(TRUE);
           settings->put_AreDefaultScriptDialogsEnabled(TRUE);
           settings->put_IsWebMessageEnabled(TRUE);
           settings->put_AreDevToolsEnabled(m_devToolsEnabled);

           settings->put_AreDefaultContextMenusEnabled(m_defaultContextMenusEnabled);
           settings->put_IsBuiltInErrorPageEnabled(m_builtInErrorPageEnabled);
           settings->put_IsStatusBarEnabled(m_statusBarEnabled);
           settings->put_IsZoomControlEnabled(m_zoomControlEnabled);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants