Uriahs Victor
Uriahs Victor

Reputation: 1155

How to change Awesomium user agent?

I have a simple form with an Awesomium webcontrol going to a website.

I found how to change the useragent in C++ but nothing for vb.net:

code for C++ http://wiki.awesomium.com/general-use/changing-the-user-agent.html

Could someone help me with this?

Upvotes: 0

Views: 1184

Answers (2)

Alan Denke
Alan Denke

Reputation: 59

I realize this is an old thread and you've probably found the answer, but I added this code to my WPF VB.net app and it worked.

    Dim config As New Awesomium.Core.WebConfig()
    If Not Awesomium.Core.WebCore.IsInitialized Then
        Awesomium.Core.WebCore.Initialize(New Awesomium.Core.WebConfig() With { _
            .HomeURL = New Uri("https://www.awesomium.com"), _
            .RemoteDebuggingPort = 2229, _
            .UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
        })
    End If

It didn't fix the problem I was trying to fix, however it did make it so Chrome doesn't report that I'm using an old version.

Upvotes: 1

Mark Hurd
Mark Hurd

Reputation: 10931

I note your answer would be here if the documentation was up to date :-(

The best we can do is see what they've said for "WPF WebControl Initialization" here, and in summary I believe what I said in my comment holds:

Note also the commentary about when things occur.

Upvotes: 0

Related Questions