Welcome Guest Search | Active Topics | Sign In | Register

CustomUserAgent Options
Panda
Posted: Wednesday, October 7, 2015 12:44:36 AM
Rank: Advanced Member
Groups: Member

Joined: 10/7/2015
Posts: 35
Hi,

It doesn't quite make sense to me that I can set the user agent, but can't "get" it.
I want to customize it via CustomUserAgent propery - http://www.essentialobjects.com/doc/6/eo.webbrowser.webview.customuseragent.aspx
I simply want to add a few characters on the end of the existing user agent string.
But there doesn't seem to be any way to get the user agent string being used...
Which is very odd.
I understand I can work out what it is, but this is really not as useful, I need to always get "whatever it is right now" and then append something.

For this, I really need a UserAgent property {get ;} only and the CustomerUserAgent property.
Can you take this as a suggestion or is there any reliable way to get the user agent string, so I don't have to hard code one in?
eo_support
Posted: Wednesday, October 7, 2015 7:32:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
Thanks for your suggestion. For now you can get one by running (string)WebView.EvalScript("Navigator userAgent").
Panda
Posted: Thursday, October 8, 2015 9:11:45 PM
Rank: Advanced Member
Groups: Member

Joined: 10/7/2015
Posts: 35
eo_support wrote:
Thanks for your suggestion. For now you can get one by running (string)WebView.EvalScript("Navigator userAgent").

Thanks, though I thought there was a typo there (should be "navigator.userAgent").
Even so, I have a timing problem here I guess... that I can't get the user agent until I've already loaded a url/page.
I tried but couldn't get webView.EvalScript("navigator.userAgent") to return anything - and I guess it's the timing.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.