Welcome Guest Search | Active Topics | Sign In | Register

CustomUserAgent do not work Options
clorest
Posted: Monday, August 7, 2017 2:26:45 PM
Rank: Advanced Member
Groups: Member

Joined: 6/24/2015
Posts: 39
hi
we try to user webView.CustomUserAgent to set useragent:

Code: C#
this.webView.CustomUserAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36";


and then read the CustomUserAgent of webview , it is setted right.

Code: C#
Debug.WriteLine((string)this.webView.EvalScript("navigator.userAgent") + "ddd");

output is :
Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36ddd

but when we open a site https://graph.qq.com/oauth/show?which=Login&display=phone&response_type=code&client_id=100273020&redirect_uri=https://wqlogin1.jd.com/mlogin/h5v1/GetCode, eo show like this(actually pc):


and chrome show like this (phone):


can you give me some advice to let eo show like chrome when useragent is setted to mobile?
clorest
Posted: Monday, August 7, 2017 11:21:45 PM
Rank: Advanced Member
Groups: Member

Joined: 6/24/2015
Posts: 39


as this picture, eo do not have "toggle device bar" as chrome.
does eo not support mobile device view?
thanks
eo_support
Posted: Tuesday, August 8, 2017 7:26:09 AM
Rank: Administration
Groups: Administration

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

You need to look into the web page to find out how the web page decides whether to display mobile view or regular view. User agent string might be just one of the factor it checks. For example, it may also check screen width. In that case you will have to resize your browser window accordingly. There might be other factors ---- the point is this completely depends on your page.

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.