changing browser user agent

907 views
Skip to first unread message

asarc...@gmail.com

unread,
Oct 22, 2014, 12:53:17 PM10/22/14
to cefs...@googlegroups.com
hey,
m making a webapp in c# using cefsharp but i want to change its user agent.please help me

Jørn Hansen

unread,
Oct 22, 2014, 4:51:44 PM10/22/14
to cefs...@googlegroups.com
On Wednesday, October 22, 2014 6:53:17 PM UTC+2, asarc...@gmail.com wrote:
> hey,
> m making a webapp in c# using cefsharp but i want to change its user agent.please help me

A quick search in the CefSharp repo often gives a few leads to follow, like https://github.com/cefsharp/CefSharp/search?q=user+agent

Best regards,
JornH

asarc...@gmail.com

unread,
Oct 22, 2014, 10:13:08 PM10/22/14
to cefs...@googlegroups.com

i can't find anything.please explain more...
i want to do it in my own project. not modifying cefsharp code

Jørn Hansen

unread,
Oct 22, 2014, 11:53:17 PM10/22/14
to cefs...@googlegroups.com
Sorry I realize now there might have been a bit too much digging in there to do =:o)
.... Too much haystack for a too small needle ...

Here's a more specific pointer: https://github.com/cefsharp/CefSharp/pull/365#issuecomment-44241573

I hope that was better?

Jørn Hansen

unread,
Oct 23, 2014, 12:02:41 AM10/23/14
to cefs...@googlegroups.com

asarc...@gmail.com

unread,
Oct 23, 2014, 8:22:02 AM10/23/14
to cefs...@googlegroups.com
I can't get it.
I've created a new winform app and added cefsharp chromium web browser in it and now i want to change its user agent from chrome to my app name...


On Wednesday, 22 October 2014 22:23:17 UTC+5:30, asarc...@gmail.com wrote:

Jørn Hansen

unread,
Oct 24, 2014, 9:53:12 AM10/24/14
to cefs...@googlegroups.com


On Thursday, October 23, 2014 2:22:02 PM UTC+2, asarc...@gmail.com wrote:
I can't get it.
I've created a new winform app and added cefsharp chromium web browser in it and now i want to change its user agent from chrome to my app name...


With that go visit http://www.useragentstring.com/ 

// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Windows.Forms;

namespace CefSharp.MinimalExample.WinForms
{
    public class Program
    {
        [STAThread]
        public static void Main()
        {
            var settings = new CefSettings();
            settings.CefCommandLineArgs.Add("user-agent", "CefSharp"); // <--- add this line

            Cef.Initialize(settings);

            var browser = new BrowserForm();
            Application.Run(browser);
        }
    }
}

Hope it's clear now?

/JornH

asarc...@gmail.com

unread,
Oct 24, 2014, 10:57:56 AM10/24/14
to cefs...@googlegroups.com
thank you so much...
it worked...


On Wednesday, 22 October 2014 22:23:17 UTC+5:30, asarc...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages