How to change user agent in chrome embedded infrastructure in C #?

Please help me change the chromium embedded infrastructure user agent in visual C #. It uses the default chromate agent, but I want to change it to use my browser name instead.

+4
source share
3 answers

Use CefSettings.UserAgent. It can also be configured using the "user-agent" command line.

+6
source

I know his old question, but it might help someone, use the following code to modify cef-sharp 3x user agent

ChromiumWebBrowser chromiumBrowser;

public Form1()
{

    InitializeComponent();

     CefSettings cfsettings=new CefSettings();
     cfsettings.UserAgent = "My/Custom/User-Agent-AndStuff";
     Cef.Initialize(cfsettings);

     chromiumBrowser = new CefSharp.WinForms.ChromiumWebBrowser("http://whatsmyuseragent.com/")
     {
        Dock = DockStyle.Fill,

     };


     this.Controls.Add(chromiumBrowser);

}
+5
source

:

Hope this helps

0
source

Source: https://habr.com/ru/post/1533489/


All Articles