Welcome Guest Search | Active Topics | Sign In | Register

custom userAgent string is not correct in javascript Options
Tank
Posted: Monday, August 4, 2014 9:15:18 AM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2014
Posts: 38
Hi There,

I have set CustomUserAgent of EO.WebBrowser control as below

private const string MYUSERAGENT = @"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.170 Safari/537.36/MYUSERAGENT";

m_webViewMain.CustomUserAgent = MYUSERAGENT;

but it is now reflecting while accessing it in javascript like

alert(navigator.userAgent.IndexOf("MYUSERAGENT"));

is there any other way to access the EO.WebBrowser object's user agent string in web pages it is hosting ?

Note: UserAgent string is correct for asp.net server side context.
eo_support
Posted: Monday, August 4, 2014 10:21:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

You can't change the user agent visible to JavaScript, the custom user agent you set is just an HTTP header entry sent to the server. If you wish to detect whether your page is running EO.WebBrowser, you can check whether global variable "eoWebBrowser" exists.

Please feel free to let us know if you still have any more questions.

Thanks!
Tank
Posted: Tuesday, August 5, 2014 5:25:14 AM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2014
Posts: 38
Thanks for the Quick Reply, it has solved our problem
eo_support
Posted: Tuesday, August 5, 2014 7:16:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
You are very welcome. Please feel free to let us know if there is anything else.

Thanks!


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.