Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop UCBrowser is wrongly detected as Mobile UCBrowser #51

Closed
yun1129 opened this issue Nov 13, 2015 · 11 comments
Closed

Desktop UCBrowser is wrongly detected as Mobile UCBrowser #51

yun1129 opened this issue Nov 13, 2015 · 11 comments

Comments

@yun1129
Copy link

yun1129 commented Nov 13, 2015

The UA of Desktop UCBrowser is UBrowser but WhichBrowser detects it as Mobile UCBrowser which is with UA of UCBrowser. The Desktop UCBrowser is available at http://pc.uc.cn (Chinese version) or http://pc.ucweb.com (Internationalization version).

@NielsLeenheer
Copy link
Member

Could you post an example user agent string?

@NielsLeenheer
Copy link
Member

You are using Chrome 44 on Windows 10

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 UBrowser/5.5.9936.1231 Safari/537.36

@NielsLeenheer
Copy link
Member

I can't reproduce UC Browser being detected as the mobile browser. But I can see that UC Browser does not use the same user agent string internally and externally.

Internal by using Javascript:

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 UBrowser/5.5.9936.1231 Safari/537.36

External headers:

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36

Notice the missing UBrowser token from the external headers. That is why UC Browser for desktop can not be detected by just looking at the browsers. It literally says it's Chrome 44.

@NielsLeenheer
Copy link
Member

Because WhichBrowser can also look at the user agent string from JavaScript, I've added a special check for this. Will be included in the next release.

@yun1129
Copy link
Author

yun1129 commented Feb 26, 2016

We really did a workaround fix by sending UA without UBrowser for getting WhichBrowser finds the right kernel version(Yes, we ONLY did this from external perspective mentioned above). Once this issue gets fixed my team will get rid of the workaround fix.

@NielsLeenheer
Copy link
Member

OK, is there a version of UC Browser still available for download that did not include the workaround, so I can reproduce it?

@NielsLeenheer NielsLeenheer reopened this Feb 26, 2016
@yun1129
Copy link
Author

yun1129 commented Feb 26, 2016

Technically, we do this control via a config file on our server. Next Monday the team will release a config without the workaround. Will post here to let you know.

@yun1129
Copy link
Author

yun1129 commented Feb 26, 2016

Rightnow, if access html5test.com via UCBrowser it seems the HTML5 score isn't the same with the one of Chrome M44, but the website really says "you are using UC Browser 5.6 on Windows 7", did you do any change on WhichBrowser and it leads to this result? I'm really not sure if this question is proper for you. If not please let me know and any clue would be apprecited.

@NielsLeenheer
Copy link
Member

I think I know what causes this.

If for some reason feature detection is broken in the browser, the browser will report back that it supports a certain feature - even if you don't. That causes HTML5test.com to count extra points, that are not really deserved. HTML5test.com uses a blacklist to correct this.

Older versions of UC Browser for Mobile are on this blacklist for a number of features. For example form fields are block on UC Browser < 8.6 and the range element and getUserMedia are blocked on UC Browser < 9.8. These problems were confirmed to be in older versions of UC Browser for Mobile, and confirmed to be fixed in later versions.

But the check is just for UC Browser. Not for UC Browser on mobile. And UC Browser for Windows uses a lower version number than mobile. That causes UC Browser for Windows to trigger that blacklist by mistake. And this will causes points to drop.

And yes, I've updated WhichBrowser yesterday to include a workaround for the missing Browser token from the headers causing UC Browser to be properly detected again. So before it didn't trigger the blacklist because it thought it was Chrome. And now it does because it thinks it is UC Browser mobile.

I'll update the blacklist on HTML5test.com.

@yun1129
Copy link
Author

yun1129 commented Feb 29, 2016

Great, you really hit the point! My team released a new config to remove the workaround mentioned in this thread. If you have any question or need help frome me please let me know.

Appreciate your quick response!

@NielsLeenheer
Copy link
Member

This change has now been implemented on the upcoming version of HTML5test.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants