Skip to content

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

Description

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?

Activity

  1. valapran-flutterint commented on Feb 21, 2025

    @valapran-flutterint
    Author

    Image

  2. brucewedding commented on Apr 2, 2025

    @brucewedding

    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

  3. valapran-flutterint commented on Apr 2, 2025

    @valapran-flutterint
    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

  4. brucewedding commented on Apr 3, 2025

    @brucewedding

    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

  5. valapran-flutterint commented on Apr 3, 2025

    @valapran-flutterint
    Author

    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(
    
  6. brucewedding commented on Apr 3, 2025

    @brucewedding

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions